NJUNLP / TOWE

Code and data for "Target-oriented Opinion Words Extraction with Target-fused Neural Sequence Labeling" (NAACL2019)
MIT License
130 stars 40 forks source link

Error when using crf "NameError: name 'CRF' is not defined" #2

Closed CamielK closed 5 years ago

CamielK commented 5 years ago

Bug: CRF not defined

When I run the train.py script with the use_crf flag set to true ( python main.py --ds 14res --use_crf True) I get the following error: NameError: name 'CRF' is not defined

This error is thrown here: https://github.com/NJUNLP/TOWE/blob/3743d651eaa8389c612c7721070474b6b8dc6128/code/networks.py#L104-L105

Training with the --use_crf flag set to False works as expected without errors. Am I missing a package or something?

yilifzf commented 5 years ago

The code of CRF model has not been uploaded yet because I cannot spare enough time cleaning and checking the CRF code which I implement from the scratch. Besides, the gain of adding CRF is not very significant in our previous experiments, so we just release the IOG-greedy code firstly. I will try to provide the support of CRF in this project as soon as possible. Before that, the other torch-based CRF projects available in the github are good references.

CamielK commented 5 years ago

Ah ok, thank you! Nice work and thanks for releasing this repo