A Transformer-based Sequence-labeling Approach to the Slovenian Cross-domain Automatic Term Extraction
In this repo, we experiment XLM-RoBERTa on RSDO5 dataset to evaluate the performance of multilingual pretrained language models in the cross-domain sequence-labeling setting of automatic term extraction (ATE) and compare our models' performance towards the benchmarks.
Please install all the necessary libraries noted in requirements.txt using this command:
pip install -r requirements.txt
The experiments were conducted on RSDO5 dataset, which is a collection of 12 documents with altogether about 250,000 words from the Slovenian language. The dataset is available at RSDO5 1.1 and contains the following domains:
RSDO5 dataset | |
---|---|
Languages | Slovenian |
Domains | Biomechanics, Chemistry, Veterinary, Linguistics |
As the orginal dataset does not follow IOB format, we preprocess the data to sequentially map each token with it regarding label. An example of IOB format is demontrated below.
For ACTER dataset, run the following command to preprocess the data:
preprocess.py [-corpus_path] [-term_path] [-output_csv_path] [-language]
where -corpus_path
is the path to the directory containing the corpus files, -term_path
is the path to the directory containing the term files, -output_csv_path
is the path to the output csv file, and -language
is the language of the corpus.
For RSDO5 dataset, the dataset is already in conll format. Please use read_conll()
function in preprocess.py
to get the mapping.
Run the following command to train the model with all the scenarios in RSDSO5 datasets:
run.sh
where run.sh
covers the 12 scenarios regarding 12 combination of train-valid-test splits with two domains of training, one domains of validation and one domains of testing.
Feel free to hyper-parameter tune the model. The current settings are:
num_train_epochs=20, # total # of training epochs
per_device_train_batch_size=32, # batch size per device during training
per_device_eval_batch_size=32, # batch size for evaluation
learning_rate=2e-5, # learning rate
eval_steps = 500,
load_best_model_at_end=True, # load the best model at the end of training
metric_for_best_model="f1",
greater_is_better=True,
Test = ling | Test = vet | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Test = kem | Test = bim | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Test = ling | Test = vet | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Test = kem | Test = bim | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
- 🐮 TRAN Thi Hong Hanh 🐮
- Matej MARTINC
- Andraz Repar
- Prof. Senja POLLAK
- Prof. Antoine DOUCET