File size: 2,403 Bytes
28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 28c3b0e deb3cb4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
---
library_name: transformers
license: cc-by-4.0
datasets:
- Johndfm/genrescoh
language:
- en
- zh
- de
- it
---
# Model Card for Model ID
<!-- Provide a quick summary of what the model is/does. -->
ECoh is a family of transformer-based decoder-only language model finetuned to assess the coherence of responses in dialogue systems.
## Model Details
### Model Sources
<!-- Provide the basic links for the model. -->
- **Repository:** https://github.com/johndmendonca/Ecoh
- **Paper:** https://arxiv.org/abs/2407.11660
## How to Get Started with the Model
Use the code below to get started with the model.
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
# load model
model_path="Johndfm/ECoh-1.8B"
tokenizer = AutoTokenizer.from_pretrained(model_path,padding_side="left")
base_model = AutoModelForCausalLM.from_pretrained(model_path).to("cuda")
# prepare example
example = "Context:\nA: Dahua's Market . How can I help you ? \nB: Where is your store located ? \n\nResponse:\nA: Our store is located on 123 Main Street, in the city center."
messages = [
{"role": "system", "content": "You are a Coherence evaluator."}
{"role": "user", "content": f"{example}\n\nGiven the context, is the response Coherent (Yes/No)? Explain your reasoning."}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to("cuda")
generated_ids = base_model.generate(
model_inputs.input_ids,
max_new_tokens=64
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
```
## Training and Evaluation Details
Please refer to the original paper.
## Citation
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
**BibTeX:**
```
@misc{mendonça2024ecoh,
title={ECoh: Turn-level Coherence Evaluation for Multilingual Dialogues},
author={John Mendonça and Isabel Trancoso and Alon Lavie},
year={2024},
eprint={2407.11660},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2407.11660},
}
```
## Model Card Contact
[email protected] |