Giter Club home page Giter Club logo

event-tensors's Introduction

event-tensors

Code and Datasets for the AAAI 2018 paper "Event Representations with Tensor-based compositions"

Requirements

  • Tensorflow Version 1.4
  • Python 3.5

Running Pretrained Models

The file get_embeddings.py gives an example script that loads in a pretrained event-tensor model, and given a dataset of SVO triples (in the same format used for training), runs the SVO triples through the model to produce event embeddings, and then prints the embeddings to a text file.

Preprocessing

We use the Open Information Extraction System Ollie to extract triples. The default settings for Ollie will produce triples with long entity and predicate names. To shorten these, you need to run Ollie with the OpenParse flag called expandExtraction set to false. To do this, you need to create your own main file to run Ollie (replacing this example main in the Ollie source) and run it. The main used for parsing the NYT Gigacorpus is provided for reference in the preproc directory. Parts of this file will need to be replaced as needed if using a different dataset.

The above preprocessing step will output a single tuple per line, which wastes quite a bit of space. In order to convert it to the format used in the training the model (one document per line), use the document_on_line.py script in the preproc directory.

event-tensors's People

Contributors

weberna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

event-tensors's Issues

StopIteration error

ub16hp@UB16HP:/ub16_prj/event-tensors$ python3.5 train_event_prediction.py
(128, 10)
(128, 10)
(128, 10)
(128, 10)
(128, 10)
(128, 10)
2018-12-02 16:14:25.420912: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
2018-12-02 16:14:25.567080: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:892] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-12-02 16:14:25.567427: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1030] Found device 0 with properties:
name: GeForce GTX 950M major: 5 minor: 0 memoryClockRate(GHz): 1.124
pciBusID: 0000:01:00.0
totalMemory: 3.95GiB freeMemory: 3.12GiB
2018-12-02 16:14:25.567462: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 950M, pci bus id: 0000:01:00.0, compute capability: 5.0)
Starting Fresh
Average Loss on 50 is 0.10399557366967202
Average Loss on 100 is 0.1009260854125023
Average Loss on 150 is 0.09745909363031385
Average Loss on 200 is 0.09509332507848742
Average Loss on 250 is 0.09339955508708954
Average Loss on 300 is 0.09256721824407578
Average Loss on 350 is 0.09019083708524704
Average Loss on 400 is 0.08809589222073558
Average Loss on 450 is 0.08994308814406395
Average Loss on 500 is 0.08769825130701064
Traceback (most recent call last):
File "train_event_prediction.py", line 446, in
train_prediction_network(instances, embeddings)
File "train_event_prediction.py", line 398, in train_prediction_network
feed_dict, done = fill_feed_dict(inst_iter, input_ph, target_ph, neg_ph, embeddings)
File "train_event_prediction.py", line 99, in fill_feed_dict
inst = next(instance_iter)
File "/home/ub16hp/ub16_prj/event-tensors/utils/train_utils.py", line 73, in iter
filled = self.fill_queue()
File "/home/ub16hp/ub16_prj/event-tensors/utils/train_utils.py", line 218, in fill_queue
neg_inst = next(self.neg_instances)[1]
StopIteration
ub16hp@UB16HP:
/ub16_prj/event-tensors$

Run on pre-trained model

Hi, I am recently work on a project and we would like to test a few things with your system. Is it possible to run new events with a pre-trained model? Say I have a few events and I want to generate representations for them. If so, could you give me a pointer? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.