Migrate model card from transformers-repo
Browse filesRead announcement at https://discuss.huggingface.co/t/announcement-all-model-cards-will-be-migrated-to-hf-co-model-repos/2755
Original file history: https://github.com/huggingface/transformers/commits/master/model_cards/SparkBeyond/roberta-large-sts-b/README.md
README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
| 4 |
|
| 5 |
This model is a fine tuned RoBERTA model over STS-B.
|
| 6 |
It was trained with these params:
|
| 7 |
-
!python /content/transformers/examples/run_glue.py \
|
| 8 |
--model_type roberta \
|
| 9 |
--model_name_or_path roberta-large \
|
| 10 |
--task_name STS-B \
|
|
@@ -40,11 +40,11 @@ def roberta_similarity_batches(to_predict):
|
|
| 40 |
return similarity_scores
|
| 41 |
|
| 42 |
def similarity_roberta(model, tokenizer, sent_pairs):
|
| 43 |
-
batch_token = tokenizer
|
| 44 |
res = model(torch.tensor(batch_token['input_ids']).cuda(), attention_mask=torch.tensor(batch_token["attention_mask"]).cuda())
|
| 45 |
return res
|
| 46 |
|
| 47 |
similarity_roberta(model, tokenizer, [('NEW YORK--(BUSINESS WIRE)--Rosen Law Firm, a global investor rights law firm, announces it is investigating potential securities claims on behalf of shareholders of Vale S.A. ( VALE ) resulting from allegations that Vale may have issued materially misleading business information to the investing public',
|
| 48 |
'EQUITY ALERT: Rosen Law Firm Announces Investigation of Securities Claims Against Vale S.A. – VALE')])
|
| 49 |
|
| 50 |
-
```
|
|
|
|
| 4 |
|
| 5 |
This model is a fine tuned RoBERTA model over STS-B.
|
| 6 |
It was trained with these params:
|
| 7 |
+
!python /content/transformers/examples/text-classification/run_glue.py \
|
| 8 |
--model_type roberta \
|
| 9 |
--model_name_or_path roberta-large \
|
| 10 |
--task_name STS-B \
|
|
|
|
| 40 |
return similarity_scores
|
| 41 |
|
| 42 |
def similarity_roberta(model, tokenizer, sent_pairs):
|
| 43 |
+
batch_token = tokenizer(sent_pairs, padding='max_length', truncation=True, max_length=500)
|
| 44 |
res = model(torch.tensor(batch_token['input_ids']).cuda(), attention_mask=torch.tensor(batch_token["attention_mask"]).cuda())
|
| 45 |
return res
|
| 46 |
|
| 47 |
similarity_roberta(model, tokenizer, [('NEW YORK--(BUSINESS WIRE)--Rosen Law Firm, a global investor rights law firm, announces it is investigating potential securities claims on behalf of shareholders of Vale S.A. ( VALE ) resulting from allegations that Vale may have issued materially misleading business information to the investing public',
|
| 48 |
'EQUITY ALERT: Rosen Law Firm Announces Investigation of Securities Claims Against Vale S.A. – VALE')])
|
| 49 |
|
| 50 |
+
```
|