truongphan
commited on
Commit
•
0ccaf92
1
Parent(s):
2d5914d
README.md
Browse files
README.md
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Vietnam Tourism Named Entity Recognition
|
2 |
+
We fine-tuned BERT to train Vietnam tourism dataset for a question answering system. The model was called NER2QUES because it detected tourism NER in a sentence. From that, the system generated questions corresponding to NER types.
|
3 |
+
# How to use
|
4 |
+
You can use the model directly with a pipeline
|
5 |
+
from simpletransformers.ner import NERModel, NERArgs
|
6 |
+
|
7 |
+
line = "King Garden is located in Thanh Thuy, Phu Tho"
|
8 |
+
model_name = 'truongphan/vntourismNER'
|
9 |
+
custom_labels = [
|
10 |
+
"O", "B-TA", "I-TA", "B-PRO", "I-PRO", "B-TEM", "I-TEM", "B-COM", "I-COM", "B-PAR", "I-PAR", "B-CIT", "I-CIT",
|
11 |
+
"B-MOU", "I-MOU", "B-HAM", "I-HAM", "B-AWA", "I-AWA", "B-VIS", "I-VIS", "B-FES", "I-FES", "B-ISL", "I-ISL",
|
12 |
+
"B-TOW", "I-TOW", "B-VIL", "I-VIL", "B-CHU", "I-CHU", "B-PAG", "I-PAG", "B-BEA", "I-BEA", "B-WAR", "I-WAR",
|
13 |
+
"B-WAT", "I-WAT", "B-SA", "I-SA", "B-SER", "I-SER", "B-STR", "I-STR", "B-NUN", "I-NUN", "B-PAL", "I-PAL",
|
14 |
+
"B-VOL", "I-VOL", "B-HIL", "I-HIL", "B-MAR", "I-MAR", "B-VAL", "I-VAL", "B-PROD", "I-PROD", "B-DIS", "I-DIS",
|
15 |
+
"B-FOO", "I-FOO", "B-DISH", "I-DISH", "B-DRI", "I-DRI"
|
16 |
+
]
|
17 |
+
|
18 |
+
model_args = NERArgs()
|
19 |
+
model = NERModel("bert", model_name, args=model_args, labels=custom_labels)
|
20 |
+
l.append(line)
|
21 |
+
predictions, raw_outputs = model.predict(l)
|
22 |
+
print(predictions)
|
23 |
+
|
24 |
+
# Authors
|
25 |
+
|
26 |
+
1. Phuc Do, University of Information Technology, Ho Chi Minh national university, Vietnam
|
27 |
+
2. Truong H. V. Phan, Van Lang university, Ho Chi Minh city, Vietnam
|