Update README
Browse files
README.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
4 |
+
# Arabic NER
|
5 |
+
|
6 |
+
'''
|
7 |
+
from transformers import pipeline, AutoModelForTokenClassification, AutoTokenizer
|
8 |
+
|
9 |
+
ner_model = AutoModelForTokenClassification.from_pretrained("ychen3411/arabic-ner-ace-gigabert")
|
10 |
+
ner_tokenizer = AutoTokenizer.from_pretrained("ychen3411/arabic-ner-ace-gigabert")
|
11 |
+
ner_pip = pipeline("ner", model=ner_model, tokenizer=ner_tokenizer, grouped_entities=True)
|
12 |
+
|
13 |
+
output = ner_pip('Protests break out across the US after Supreme Court overturns.')
|
14 |
+
print(output)
|
15 |
+
[{'entity_group': 'GPE', 'score': 0.9979881, 'word': 'us', 'start': 30, 'end': 32}, {'entity_group': 'ORG', 'score': 0.99898684, 'word': 'supreme court', 'start': 39, 'end': 52}]
|
16 |
+
|
17 |
+
output = ner_pip('ูุงู ูุฒูุฑ ุงูุนุฏู ุงูุชุฑูู ุจููุฑ ุจูุฒุฏุงุบ ุฅู ุฃููุฑุฉ ุชุฑูุฏ 12 ู
ุดุชุจูุงู ุจูู
ู
ู ููููุฏุง ู 21 ู
ู ุงูุณููุฏ')
|
18 |
+
print(output)
|
19 |
+
[{'entity_group': 'PER', 'score': 0.9996214, 'word': 'ูุฒูุฑ', 'start': 4, 'end': 8}, {'entity_group': 'ORG', 'score': 0.9952383, 'word': 'ุงูุนุฏู', 'start': 9, 'end': 14}, {'entity_group': 'GPE', 'score': 0.9996675, 'word': 'ุงูุชุฑูู', 'start': 15, 'end': 21}, {'entity_group': 'PER', 'score': 0.9978992, 'word': 'ุจููุฑ ุจูุฒุฏุงุบ', 'start': 22, 'end': 33}, {'entity_group': 'GPE', 'score': 0.9997154, 'word': 'ุงููุฑุฉ', 'start': 37, 'end': 42}, {'entity_group': 'PER', 'score': 0.9946885, 'word': 'ู
ุดุชุจูุง ุจูู
', 'start': 51, 'end': 62}, {'entity_group': 'GPE', 'score': 0.99967396, 'word': 'ููููุฏุง', 'start': 66, 'end': 72}, {'entity_group': 'PER', 'score': 0.99694425, 'word': '21', 'start': 75, 'end': 77}, {'entity_group': 'GPE', 'score': 0.99963355, 'word': 'ุงูุณููุฏ', 'start': 81, 'end': 87}]
|
20 |
+
'''
|