Update README.md
Browse files
README.md
CHANGED
@@ -33,19 +33,20 @@ Sentence 4 has a subject-verb agreement error.
|
|
33 |
**example_usage:**
|
34 |
*library: HuggingFace transformers*
|
35 |
```python
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
49 |
```
|
50 |
|
51 |
**Intended Use Cases**
|
|
|
33 |
**example_usage:**
|
34 |
*library: HuggingFace transformers*
|
35 |
```python
|
36 |
+
import torch
|
37 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained("salesken/query_wellformedness_score")
|
39 |
+
model = AutoModelForSequenceClassification.from_pretrained("salesken/query_wellformedness_score")
|
40 |
+
sentences = [
|
41 |
+
'what was the reason for everyone to leave the company',
|
42 |
+
'What was the reason behind everyone leaving the company',
|
43 |
+
# ... other sentences
|
44 |
+
]
|
45 |
+
features = tokenizer(sentences, padding=True, truncation=True, return_tensors="pt")
|
46 |
+
model.eval()
|
47 |
+
with torch.no_grad():
|
48 |
+
scores = model(**features).logits
|
49 |
+
print(scores)
|
50 |
```
|
51 |
|
52 |
**Intended Use Cases**
|