Update README.md
Browse files
README.md
CHANGED
|
@@ -82,7 +82,7 @@ texts = [
|
|
| 82 |
]
|
| 83 |
|
| 84 |
# prepare the input
|
| 85 |
-
encoding =
|
| 86 |
texts,
|
| 87 |
add_special_tokens=True,
|
| 88 |
return_token_type_ids=True,
|
|
@@ -92,7 +92,7 @@ encoding = formality_tokenizer(
|
|
| 92 |
)
|
| 93 |
|
| 94 |
# inference
|
| 95 |
-
output =
|
| 96 |
|
| 97 |
formality_scores = [
|
| 98 |
{id2formality[idx]: score for idx, score in enumerate(text_scores.tolist())}
|
|
|
|
| 82 |
]
|
| 83 |
|
| 84 |
# prepare the input
|
| 85 |
+
encoding = tokenizer(
|
| 86 |
texts,
|
| 87 |
add_special_tokens=True,
|
| 88 |
return_token_type_ids=True,
|
|
|
|
| 92 |
)
|
| 93 |
|
| 94 |
# inference
|
| 95 |
+
output = model(**encoding)
|
| 96 |
|
| 97 |
formality_scores = [
|
| 98 |
{id2formality[idx]: score for idx, score in enumerate(text_scores.tolist())}
|