Tillicollaps
commited on
Commit
•
e4502f5
1
Parent(s):
f2f7180
Update README.md
Browse files
README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
-
|
|
|
|
|
4 |
---
|
5 |
|
6 |
# Model Card for Model ID
|
@@ -35,6 +37,22 @@ This is the model card of a 🤗 transformers model that has been pushed on the
|
|
35 |
|
36 |
## Uses
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
39 |
|
40 |
### Direct Use
|
|
|
1 |
---
|
2 |
library_name: transformers
|
3 |
+
language:
|
4 |
+
- ru
|
5 |
+
pipeline_tag: text-classification
|
6 |
---
|
7 |
|
8 |
# Model Card for Model ID
|
|
|
37 |
|
38 |
## Uses
|
39 |
|
40 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
41 |
+
from transformers import TextClassificationPipeline,
|
42 |
+
from transliterate import translit
|
43 |
+
|
44 |
+
tokenizer = AutoTokenizer.from_pretrained("distilbert/distilbert-base-uncased")
|
45 |
+
model = AutoModelForSequenceClassification.from_pretrained("CustomModel_Russia", num_labels=2)
|
46 |
+
nlp = TextClassificationPipeline(model=model, tokenizer=tokenizer)
|
47 |
+
#If the language of the text is different from English, use the 'translit' library.
|
48 |
+
|
49 |
+
name = "Cтанислав"
|
50 |
+
|
51 |
+
tran = translit(name, language_code='ru', reversed=True)
|
52 |
+
|
53 |
+
result = nlp(tran)
|
54 |
+
|
55 |
+
|
56 |
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
57 |
|
58 |
### Direct Use
|