yeshpanovrustem
commited on
Commit
•
c49a73d
1
Parent(s):
71f802f
Update README.md
Browse files
README.md
CHANGED
@@ -45,6 +45,24 @@ example = "Қазақстан Республикасы — Шығыс Еуроп
|
|
45 |
|
46 |
ner_results = nlp(example)
|
47 |
print(ner_results)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
```
|
49 |
|
50 |
## Evaluation results on the validation and test sets
|
|
|
45 |
|
46 |
ner_results = nlp(example)
|
47 |
print(ner_results)
|
48 |
+
|
49 |
+
token = ""
|
50 |
+
label_list = []
|
51 |
+
token_list = []
|
52 |
+
|
53 |
+
for result in ner_results:
|
54 |
+
if result["word"].startswith("▁"):
|
55 |
+
if token:
|
56 |
+
token_list.append(token.replace("▁", ""))
|
57 |
+
token = result["word"]
|
58 |
+
label_list.append(result["entity"])
|
59 |
+
else:
|
60 |
+
token += result["word"]
|
61 |
+
|
62 |
+
token_list.append(token.replace("▁", ""))
|
63 |
+
|
64 |
+
for token, label in zip(token_list, label_list):
|
65 |
+
print(f"{token}\t{label}")
|
66 |
```
|
67 |
|
68 |
## Evaluation results on the validation and test sets
|