Code Monkey home page Code Monkey logo

ccgtemp's Introduction

Logical Inference System for Temporal Order

Setup

The system runs on docker. You need to execute the following commands.

$ docker pull masashiy/ccg2lambda
$ docker run -w /root/ -d -it -v <WORKDIR>:/home --name ccg2lambda masashiy/ccg2lambda:latest
$ docker exec -it ccg2lambda /bin/bash
$ apt update
$ apt install unzip

Then, you should clone this repository and place it on the container.

$ git clone https://github.com/ynklab/ccgtemp.git
$ cd ccgtemp

It is necessary to install depccg (version 1.1.0), janome (version 0.3.9), more_itertools.

$ pip install depccg==1.1.0 janome==0.3.9 more_itertools
$ depccg_ja download

In addition, vampire Ver.4.4 with Z3 and tregex Ver.3.9.2 are required. (You should rename the vampire file to "vampire".)

$ curl --create-dirs -o "vampire/vampire" https://vprover.github.io/bin/vampire_z3_rel_static_release_v4.4
$ chmod 755 vampire/vampire
$ wget https://nlp.stanford.edu/software/stanford-tregex-2018-10-16.zip
$ unzip stanford-tregex-2018-10-16.zip
$ rm stanford-tregex-2018-10-16.zip

You need to write the path to the vampire and tregex directories in vampire_location.txt and tregex_location.txt respectively.

$ echo "./vampire" > vampire_location.txt
$ echo "./stanford-tregex-2018-10-16" > tregex_location.txt

data

Dataset is in data directory.

  • data/jsem/jsem_temporal_order.csv: JSeM problems involving temporal order.
  • data/plmute/cs1_test_ja.csv: test data of PLMUTE
  • data/plmute/cs1_train_ja.csv: all training data of PLMUTE
  • data/plmute/cs1_test_ja.csv: part of training data of PLMUTE

Usage

Sample Problem

If you want to perform inference with a sample problem, you can run commands like the following.

$ ./rte_tsurgeon_vamp.sh sample.txt templates/semantic_templates_ja_tense.yaml ja vampire 1 templates/transform.tsgn sample_dir
$ cat sample_dir/ja_results/sample.txt.answer

If you want to perform inference with a different problem, you need to delete the output of the previous inference.

JSeM

If you want to perform inference with jsem, you can run following commands.

$ python3 make_problems.py jsem
$ ./temporal_inference_wrap.sh jsem

The result will be output to jsem/overall_results.tsv.

PLMUTE

If you want to perform inference with PLMUTE_ja, you can run following commands.

$ python3 make_problems.py plmute
$ ./temporal_inference_wrap.sh plmute

It may take 20 hours to complete. (Depends on the performance of the execution environment)

The result will be output to plmute/overall_results.tsv.

Citation

If you use this dataset in any published research, please cite the following:

@inproceedings{sugimoto-yanaka-2022-compositional,
    title = "Compositional Semantics and Inference System for Temporal Order based on {J}apanese {CCG}",
    author = "Sugimoto, Tomoki  and
      Yanaka, Hitomi",
    booktitle = "Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics: Student Research Workshop",
    month = may,
    year = "2022",
    address = "Dublin, Ireland",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2022.acl-srw.10",
    pages = "104--114",
}

Contact

For questions and usage issues, please contact [email protected] .

License

ccgtemp's People

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.