zhangfan
commited on
Commit
•
2f72338
1
Parent(s):
0147d71
Update README.md
Browse files
README.md
CHANGED
@@ -13,7 +13,7 @@ should probably proofread and complete it, then remove this comment. -->
|
|
13 |
# bert-uncased-base
|
14 |
|
15 |
This model is a fine-tuned version of [bert-base-uncased](https://huggingface.co/bert-base-uncased) on an Reddit-dialogue dataset.
|
16 |
-
This model can be used for Text Classification: Given two sentences
|
17 |
It achieves the following results on the evaluation set:
|
18 |
- Loss: 0.2297
|
19 |
- Accuracy: 0.9267
|
@@ -54,7 +54,7 @@ label_list = ['matched', 'unmatched']
|
|
54 |
tokenizer = AutoTokenizer.from_pretrained("Fan-s/reddit-tc-bert", use_fast=True)
|
55 |
model = AutoModelForSequenceClassification.from_pretrained("Fan-s/reddit-tc-bert")
|
56 |
|
57 |
-
#
|
58 |
post = "don't make gravy with asbestos."
|
59 |
response = "i'd expect someone with a culinary background to know that. since we're talking about school dinner ladies, they need to learn this pronto."
|
60 |
|
@@ -69,6 +69,6 @@ def predict(post, response, max_seq_length=128):
|
|
69 |
return predict_label, logits
|
70 |
|
71 |
# predict whether the two sentences match
|
72 |
-
predict_label = predict(post, response)
|
73 |
print("predict_label:", predict_label)
|
74 |
```
|
|
|
13 |
# bert-uncased-base
|
14 |
|
15 |
This model is a fine-tuned version of [bert-base-uncased](https://huggingface.co/bert-base-uncased) on an Reddit-dialogue dataset.
|
16 |
+
This model can be used for Text Classification: Given two sentences, see if they are related.
|
17 |
It achieves the following results on the evaluation set:
|
18 |
- Loss: 0.2297
|
19 |
- Accuracy: 0.9267
|
|
|
54 |
tokenizer = AutoTokenizer.from_pretrained("Fan-s/reddit-tc-bert", use_fast=True)
|
55 |
model = AutoModelForSequenceClassification.from_pretrained("Fan-s/reddit-tc-bert")
|
56 |
|
57 |
+
# Set the input
|
58 |
post = "don't make gravy with asbestos."
|
59 |
response = "i'd expect someone with a culinary background to know that. since we're talking about school dinner ladies, they need to learn this pronto."
|
60 |
|
|
|
69 |
return predict_label, logits
|
70 |
|
71 |
# predict whether the two sentences match
|
72 |
+
predict_label, logits = predict(post, response)
|
73 |
print("predict_label:", predict_label)
|
74 |
```
|