All Projects โ†’ may- โ†’ Cnn Re Tf

may- / Cnn Re Tf

Convolutional Neural Network for Multi-label Multi-instance Relation Extraction in Tensorflow

Projects that are alternatives of or similar to Cnn Re Tf

Self Driving Car
A End to End CNN Model which predicts the steering wheel angle based on the video/image
Stars: โœญ 106 (-44.21%)
Mutual labels:  jupyter-notebook, cnn
Image classifier
CNN image classifier implemented in Keras Notebook ๐Ÿ–ผ๏ธ.
Stars: โœญ 139 (-26.84%)
Mutual labels:  jupyter-notebook, cnn
Deeplearning tutorials
The deeplearning algorithms implemented by tensorflow
Stars: โœญ 1,580 (+731.58%)
Mutual labels:  jupyter-notebook, cnn
Codesearchnet
Datasets, tools, and benchmarks for representation learning of code.
Stars: โœญ 1,378 (+625.26%)
Mutual labels:  jupyter-notebook, cnn
Dgc Net
A PyTorch implementation of "DGC-Net: Dense Geometric Correspondence Network"
Stars: โœญ 159 (-16.32%)
Mutual labels:  jupyter-notebook, cnn
Keras Oneclassanomalydetection
[5 FPS - 150 FPS] Learning Deep Features for One-Class Classification (AnomalyDetection). Corresponds RaspberryPi3. Convert to Tensorflow, ONNX, Caffe, PyTorch. Implementation by Python + OpenVINO/Tensorflow Lite.
Stars: โœญ 102 (-46.32%)
Mutual labels:  jupyter-notebook, cnn
Pytorch Sift
PyTorch implementation of SIFT descriptor
Stars: โœญ 123 (-35.26%)
Mutual labels:  jupyter-notebook, cnn
Cnn intent classification
CNN for intent classification task in a Chatbot
Stars: โœญ 90 (-52.63%)
Mutual labels:  jupyter-notebook, cnn
Ruijin round2
็‘ž้‡‘ๅŒป้™ขMMCไบบๅทฅๆ™บ่ƒฝ่พ…ๅŠฉๆž„ๅปบ็Ÿฅ่ฏ†ๅ›พ่ฐฑๅคง่ต›ๅค่ต›
Stars: โœญ 159 (-16.32%)
Mutual labels:  jupyter-notebook, relation-extraction
Bertem
่ฎบๆ–‡ๅฎž็Žฐ(ACL2019)๏ผšใ€ŠMatching the Blanks: Distributional Similarity for Relation Learningใ€‹
Stars: โœญ 146 (-23.16%)
Mutual labels:  jupyter-notebook, relation-extraction
Facedetector
A re-implementation of mtcnn. Joint training, tutorial and deployment together.
Stars: โœญ 99 (-47.89%)
Mutual labels:  jupyter-notebook, cnn
Keraspp
์ฝ”๋”ฉ์…ฐํ”„์˜ 3๋ถ„ ๋”ฅ๋Ÿฌ๋‹, ์ผ€๋ผ์Šค๋ง›
Stars: โœญ 178 (-6.32%)
Mutual labels:  jupyter-notebook, cnn
Pytorch Learners Tutorial
PyTorch tutorial for learners
Stars: โœญ 97 (-48.95%)
Mutual labels:  jupyter-notebook, cnn
Models
DLTK Model Zoo
Stars: โœญ 101 (-46.84%)
Mutual labels:  jupyter-notebook, cnn
Pytorch Pos Tagging
A tutorial on how to implement models for part-of-speech tagging using PyTorch and TorchText.
Stars: โœญ 96 (-49.47%)
Mutual labels:  jupyter-notebook, cnn
Keras transfer cifar10
Object classification with CIFAR-10 using transfer learning
Stars: โœญ 120 (-36.84%)
Mutual labels:  jupyter-notebook, cnn
Pytorch
PyTorch tutorials A to Z
Stars: โœญ 87 (-54.21%)
Mutual labels:  jupyter-notebook, cnn
End To End Sequence Labeling Via Bi Directional Lstm Cnns Crf Tutorial
Tutorial for End-to-end Sequence Labeling via Bi-directional LSTM-CNNs-CRF
Stars: โœญ 87 (-54.21%)
Mutual labels:  jupyter-notebook, cnn
Visualizing cnns
Using Keras and cats to visualize layers from CNNs
Stars: โœญ 143 (-24.74%)
Mutual labels:  jupyter-notebook, cnn
Relation Classification Using Bidirectional Lstm Tree
TensorFlow Implementation of the paper "End-to-End Relation Extraction using LSTMs on Sequences and Tree Structures" and "Classifying Relations via Long Short Term Memory Networks along Shortest Dependency Paths" for classifying relations
Stars: โœญ 167 (-12.11%)
Mutual labels:  jupyter-notebook, relation-extraction

Convolutional Neural Network for Relation Extraction

Note: This project is mostly based on https://github.com/yuhaozhang/sentence-convnet


Requirements

To download wikipedia articles (distant_supervision.py)

To visualize the results (visualize.ipynb)

Data

  • data directory includes preprocessed data:

    cnn-re-tf
    โ”œโ”€โ”€ ...
    โ”œโ”€โ”€ word2vec
    โ””โ”€โ”€ data
        โ”œโ”€โ”€ er              # binay-classification dataset
        โ”‚   โ”œโ”€โ”€ source.txt      #   source sentences
        โ”‚   โ””โ”€โ”€ target.txt      #   target labels
        โ””โ”€โ”€ mlmi            # multi-label multi-instance dataset
            โ”œโ”€โ”€ source.att      #   attention
            โ”œโ”€โ”€ source.left     #   left context
            โ”œโ”€โ”€ source.middle   #   middle context
            โ”œโ”€โ”€ source.right    #   right context
            โ”œโ”€โ”€ source.txt      #   source sentences
            โ””โ”€โ”€ target.txt      #   target labels
    

    To reproduce:

    python ./distant_supervision.py
    
  • word2vec directory is empty. Please download the Google News pretrained vector data from this Google Drive link, and unzip it to the directory. It will be a .bin file.

Usage

Preprocess

python ./util.py

It creates vocab.txt, ids.txt and emb.npy files.

Training

  • Binary classification (ER-CNN):

    python ./train.py --sent_len=3 --vocab_size=11208 --num_classes=2 --train_size=15000 \
    --data_dir=./data/er --attention=False --multi_label=False --use_pretrain=False
    
  • Multi-label multi-instance learning (MLMI-CNN):

    python ./train.py --sent_len=255 --vocab_size=36112 --num_classes=23 --train_size=10000 \
    --data_dir=./data/mlmi --attention=True --multi_label=True --use_pretrain=True
    
  • Multi-label multi-instance Context-wise learning (MLMI-CONT):

    python ./train_context.py --sent_len=102 --vocab_size=36112 --num_classes=23 --train_size=10000 \
    --data_dir=./data/mlmi --attention=True --multi_label=True --use_pretrain=True
    

Caution: A wrong value for input-data-dependent options (sent_len, vocab_size and num_class) may cause an error. If you want to train the model on another dataset, please check these values.

Evaluation

python ./eval.py --train_dir=./train/1473898241

Replace the --train_dir with the output from the training.

Run TensorBoard

tensorboard --logdir=./train/1473898241

Architecture

CNN Architecture

Results

P R F AUC init_lr l2_reg
ER-CNN 0.9410 0.8630 0.9003 0.9303 0.005 0.05
MLMI-CNN 0.8205 0.6406 0.7195 0.7424 1e-3 1e-4
MLMI-CONT 0.8819 0.7158 0.7902 0.8156 1e-3 1e-4

F1 AUC Loss PR_Curve ER-CNN Embeddings MLMI-CNN Embeddings MLMI-CONT Left Embeddings MLMI-CONT Right Embeddings

*As you see above, these models somewhat suffer from overfitting ...

References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].