Convolutional Neural Networks for Relation Extraction
Tensorflow Implementation of Deep Learning Approach for Relation Extraction Challenge(SemEval-2010 Task #8: Multi-Way Classification of Semantic Relations Between Pairs of Nominals) via Convolutional Neural Networks.
Usage
Train
- Train data is located in "SemEval2010_task8_all_data/SemEval2010_task8_training/TRAIN_FILE.TXT".
- "GoogleNews-vectors-negative300" is used as pre-trained word2vec model.
- Performance (accuracy and f1-socre) outputs during training are NOT OFFICIAL SCORE of SemEval 2010 Task 8. To compute the official performance, you should proceed the follow Evaluation step with checkpoints obtained by training.
Display help message:
$ python train.py --help
Train Example:
$ python train.py --embedding_path "GoogleNews-vectors-negative300.bin"
Evaluation
- You can get an OFFICIAL SCORE of SemEval 2010 Task 8 for test data by following this step. README describes how to evaluate the official score.
- Test data is located in "SemEval2010_task8_all_data/SemEval2010_task8_testing_keys/TEST_FILE_FULL.TXT".
- MUST GIVE
--checkpoint_dir
ARGUMENT, checkpoint directory from training run, like below example.
Evaluation Example:
$ python eval.py --checkpoint_dir "runs/1523902663/checkpoints/"
Results
Officiail Performance
Learning Curve (Accuracy)
Learning Curve (Loss)
SemEval-2010 Task #8
- Given: a pair of nominals
- Goal: recognize the semantic relation between these nominals.
- Example:
- "There were apples, pears and oranges in the bowl."
→ CONTENT-CONTAINER(pears, bowl)
- “The cup contained tea from dried ginseng.”
→ ENTITY-ORIGIN(tea, ginseng)
The Inventory of Semantic Relations
- Cause-Effect(CE): An event or object leads to an effect(those cancers were caused by radiation exposures)
- Instrument-Agency(IA): An agent uses an instrument(phone operator)
- Product-Producer(PP): A producer causes a product to exist (a factory manufactures suits)
- Content-Container(CC): An object is physically stored in a delineated area of space (a bottle full of honey was weighed) Hendrickx, Kim, Kozareva, Nakov, O S´ eaghdha, Pad ´ o,´ Pennacchiotti, Romano, Szpakowicz Task Overview Data Creation Competition Results and Discussion The Inventory of Semantic Relations (III)
- Entity-Origin(EO): An entity is coming or is derived from an origin, e.g., position or material (letters from foreign countries)
- Entity-Destination(ED): An entity is moving towards a destination (the boy went to bed)
- Component-Whole(CW): An object is a component of a larger whole (my apartment has a large kitchen)
- Member-Collection(MC): A member forms a nonfunctional part of a collection (there are many trees in the forest)
- Message-Topic(CT): An act of communication, written or spoken, is about a topic (the lecture was about semantics)
- OTHER: If none of the above nine relations appears to be suitable.
Distribution for Dataset
Reference
- Relation Classification via Convolutional Deep Neural Network (COLING 2014), D Zeng et al. [review] [paper]
- Relation Extraction: Perspective from Convolutional Neural Networks (NAACL 2015), TH Nguyen et al. [review] [paper]
- dennybritz's cnn-text-classification-tf repository [github]