- python==3.7.4
- pytorch==1.8.1
- huggingface transformers==4.5.1
- numpy
- tqdm
├── root
│ └── Entity-Detection
│ └── dataset
│ ├── conll2003_train.json
│ ├── conll2003_tag_to_id.json
│ ├── politics_train.json
│ ├── politics_dev.json
│ ├── politics_test.json
│ ├── politics_tag_to_id.json
│ └── ...
│ └── models
│ ├── __init__.py
│ └── modeling_span.py
│ └── utils
│ ├── __init__.py
│ ├── config.py
│ ├── data_utils.py
│ ├── eval.py
│ └── ...
│ └── ptms
│ └── ... (trained results, e.g., saved models, log file)
│ └── cached_models
│ └── ... (BERT-Base, which will be downloaded automatically)
│ └── run_script.py
│ └── run_script.sh
│ └── Type-Prediction
│ └── dataset
│ ├── conll2003_train.json
│ ├── conll2003_tag_to_id.json
│ ├── politics_train.json
│ ├── politics_dev.json
│ ├── politics_test.json
│ ├── politics_tag_to_id.json
│ └── ...
│ └── models
│ ├── __init__.py
│ └── modeling_type.py
│ └── utils
│ ├── __init__.py
│ ├── config.py
│ ├── data_utils.py
│ └── eval.py
│ └── ptms
│ └── ... (trained results, e.g., saved models, log file)
│ └── cached_models
│ └── ... (BERT-Base, which will be downloaded automatically)
│ └── run_script.py
│ └── run_script.sh
cd Entity-Detection/
sh run_script.sh <GPU ID> <Target> True False <Source> Train
e.g., CoNLL2003 (Source) ---> politics (Target)
sh run_script.sh 0 politics True False conll2003 Train
sh run_script.sh <GPU ID> <Target> False True <Source> <EVAL>
e.g., CoNLL2003 (Source) ---> politics (Target)
sh run_script.sh 0 politics False True conll2003 dev
sh run_script.sh 0 politics False True conll2003 test
cp ptms/politics/dev_pred_spans.json ../Type-Prediction/dataset/
cp ptms/politics/test_pred_spans.json ../Type-Prediction/dataset/
cd ../Type-Prediction/
python dataset/combine.py --target politics --eval dev
python dataset/combine.py --target politics --eval test
sh run_script.sh <GPU ID> <Target> True False <Source> Train 1.0
e.g., CoNLL2003 (Source) ---> politics (Target)
sh run_script.sh 0 politics True False conll2003 Train 1.0
sh run_script.sh 0 politics False True conll2003 test 0.6