Skip to content

Commit b4066f6

Browse files
author
Rahul
committed
better README
1 parent 1c90605 commit b4066f6

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,36 @@
33
1. Create conda env: `conda create -n pos-bert python=3.7`
44
2. Install dependencies: `pip install -r requirements.txt`
55
3. Download UD: Use [this link](https://lindat.mff.cuni.cz/repository/xmlui/handle/11234/1-3226) to download all treebanks, unzip and place them inside `data` folder
6-
4. Rename the files in the concerned treebanks to `train/dev/test.conllu`
7-
5. Meta-train pos-tagger: `python meta_trainer.py ewt partut` (can take arbitrary number of datasets)
8-
6. Evaluate pos-tagger: `python test.py ewt partut --split=test`
6+
4. TODO: Make a script to create the 'x' folder inside `data`
7+
5. Create new configs in the `configs` folder and use them to start training
98

9+
Trainer usage
10+
```
11+
usage: trainer.py [-h] --config_path CONFIG_PATH [--train_type {meta,mtl}]
12+
13+
Train a classifier
14+
15+
optional arguments:
16+
-h, --help show this help message and exit
17+
--config_path CONFIG_PATH
18+
Path of the config containing training params
19+
--train_type {meta,mtl}
20+
Whether to perform MTL or meta-training
21+
```
22+
23+
Tester usage
24+
```
25+
usage: tester.py [-h] --test_path TEST_PATH --model_path MODEL_PATH
26+
[-e {meta,full,both}]
27+
28+
Test POS tagging on various UD datasets
29+
30+
optional arguments:
31+
-h, --help show this help message and exit
32+
--test_path TEST_PATH
33+
Datasets to test on
34+
--model_path MODEL_PATH
35+
Path of the model to load
36+
-e {meta,full,both}, --eval_type {meta,full,both}
37+
Type of evaluation to perform
38+
```

tester.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ def meta_evaluate(dataset, label_map, bert_model, clf_head, config):
8686

8787
def init_args():
8888
parser = argparse.ArgumentParser(description="Test POS tagging on various UD datasets")
89-
parser.add_argument("--test_path", dest="test_path", type=str, help="Datasets to test on", required=True)
89+
parser.add_argument("--test_path", dest="test_path", type=str, help="Dataset to test on", required=True)
9090
parser.add_argument("--model_path", dest="model_path", type=str, help="Path of the model to load", required=True)
9191
parser.add_argument(
9292
"-e",
9393
"--eval_type",
94-
help="Type of evaluation (meta/regular)",
94+
help="Type of evaluation to perform",
9595
choices=["meta", "full", "both"],
9696
default="both",
9797
)

0 commit comments

Comments
 (0)