Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
XINGXIAOYU authored Aug 20, 2019
1 parent af1a597 commit f962698
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# LexiconNER
This is the implementation of "Named Entity Recognition using Positive-Unlabeled Learning" published at ACL2019.

###Set up and run
### Set up and run
Download glove.6B.100d.txt
### Environment
pytorch 1.1.0
python 3.6.4
cuda 8.0
### Instructions for running code
#### Phrase one <train bnPU model>
#### Phrase one \<train bnPU model\>
**Train**
Print parameters
`run feature_pu_model.py --h`
```html
optional arguments:
-h, --help show this help message and exit
--lr LR learning rate
Expand All @@ -27,18 +28,24 @@ optional arguments:
epochs for printing result
--pert PERT percentage of data use for training
--type TYPE pu learning type (bnpu/bpu/upu)
```
e.g.)
Train on PER type of conll2003 dataset:
`python feature_pu_model.py --dataset conll2003 --type PER`
** Evaluating**
** Evaluating**
```html
python feature_pu_model_evl.py --model saved_model/bnpu_conll2003_PER_lr_0.0001_prior_0.3_beta_0.0_gamma_1.0_percent_1.0 --flag PER --dataset conll2003 --output 1
```
replace the model name from the training
python final_evl.py
```html
python final_evl.py
```
Get the final result on all the entity type. Remember to revise the filenames to be the output file name of evaluating.

#### Phrase two <train adaPU model>
#### Phrase two \<train adaPU model\>
**dictionary generation**
`run python ada_dict_generation.py -h`
```html
optional arguments:
-h, --help show this help message and exit
--beta BETA learning rate
Expand All @@ -55,10 +62,12 @@ optional arguments:
use unlabeled data or not
--pert PERT percentage of data use for training
--model MODEL saved model name
```
e.g.)
`python ada_dict_generation.py --model saved_model/bnpu_conll2003_PER_lr_0.0001_prior_0.3_beta_0.0_gamma_1.0_percent_1.0 --flag PER --iter 1`
**adaptive training**
`run python adaptive_pu_model.py -h
`run python adaptivepumodel.py -h
````html
optional arguments:
-h, --help show this help message and exit
--beta BETA beta of pu learning (default 0.0)
Expand All @@ -75,6 +84,7 @@ optional arguments:
file
--model MODEL saved model name
--iter ITER iteration time
```
e.g.)
`python adaptive\_pu\_model.py --model saved\_model/bnpu\_conll2003\_PER\_lr\_0.0001\_prior\_0.3\_beta\_0.0\_gamma\_1.0\_percent\_1.0 --flag PER --iter 1`
Replace saved model names and iteration times when doing adaptive learning. And in the same iteration the iter number in dictionary generation and adaptive learning should be same.
Replace saved model names and iteration times when doing adaptive learning. And in the same iteration the iter number in dictionary generation and adaptive learning should be same.

0 comments on commit f962698

Please sign in to comment.