shahrukhx01
commited on
Commit
·
efe2834
1
Parent(s):
1a7e9ae
Update README.md
Browse files
README.md
CHANGED
@@ -44,4 +44,15 @@ predictions = torch.argmax(torch.softmax(logits, dim=1).detach().cpu(), axis=1)
|
|
44 |
for input, prediction in zip(input, predictions):
|
45 |
print(f"task: {task_name}, input: {input} \n prediction=> {prediction}")
|
46 |
print()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
```
|
|
|
44 |
for input, prediction in zip(input, predictions):
|
45 |
print(f"task: {task_name}, input: {input} \n prediction=> {prediction}")
|
46 |
print()
|
47 |
+
|
48 |
+
|
49 |
+
## Statement vs Question Classifier
|
50 |
+
input = ["where is berlin?", "is this a keyword query?", "Berlin is in Germany."]
|
51 |
+
task_name="spaadia_squad_pairs"
|
52 |
+
sequence = tokenizer(input, padding=True, return_tensors="pt")['input_ids']
|
53 |
+
logits = model(sequence, task_name=task_name)[0]
|
54 |
+
predictions = torch.argmax(torch.softmax(logits, dim=1).detach().cpu(), axis=1)
|
55 |
+
for input, prediction in zip(input, predictions):
|
56 |
+
print(f"task: {task_name}, input: {input} \n prediction=> {prediction}")
|
57 |
+
print()
|
58 |
```
|