GithubHelp home page GithubHelp logo

isabella232 / semantic_parsing_with_constrained_lm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/semantic_parsing_with_constrained_lm

0.0 0.0 0.0 981 KB

Code to reproduce experiments in the paper "Constrained Language Models Yield Few-Shot Semantic Parsers" (EMNLP 2021).

License: MIT License

Python 100.00%

semantic_parsing_with_constrained_lm's Introduction

Semantic Parsing with Constrained Language Models

License: MIT

This repository contains tools and instructions for reproducing the experiments in the following papers:

  1. Constrained Language Models Yield Few-Shot Semantic Parsers (EMNLP 2021).

    @inproceedings{ConstrainedLMSemanticParser2021,
        title = "Constrained Language Models Yield Few-Shot Semantic Parsers",
        author = "Shin, Richard and Lin, Christopher H. and Thomson, Sam and Chen, Charles and Roy, Subhro and Platanios,  Emmanouil Antonios and Pauls, Adam and Klein, Dan and Eisner, Jason and Van Durme, Benjamin",
        booktitle = "Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing",
        year = "2021",
        publisher = "Association for Computational Linguistics",
    }
  2. BenchCLAMP: A Benchmark for Evaluating Language Models on Semantic Parsing

    @misc{BenchCLAMP2022,
        doi = {10.48550/ARXIV.2206.10668},
        url = {https://arxiv.org/abs/2206.10668},
        author = {Roy, Subhro and Thomson, Sam and Chen, Tongfei and Shin, Richard and Pauls, Adam and Eisner, Jason and Van Durme, Benjamin},
        title = {{BenchCLAMP}: A Benchmark for Evaluating Language Models on Semantic Parsing},
        publisher = {arXiv},
        year = {2022},
    }

If you use any source code or data included in this toolkit in your work, please cite the relevant paper.

Initial set-up

First, check that we are not unintentionally in a virtualenv. Run poetry env info; under "Virtualenv", it should show Path: NA. If it displays the path to an existing virtualenv, deactivate it, for example by running deactivate or conda deactivate.

Then run the following to set up the package:

cd semantic_parsing_with_constrained_lm
poetry config virtualenvs.in-project true --local
poetry env use <path to python3.7>
poetry install
poetry shell

Before running any of the commands below, run poetry shell to activate the virtualenv where all packages have been installed. You can exit to deactivate the virtualenv.

To run any experiments with GPT-3, you will need to obtain an API key from OpenAI at https://beta.openai.com/ and set an environment variable.

export OPENAI_API_KEY=<your API key>

The GPT-3 experiments use the "davinci" engine by default. You can use a different engine by setting the OPENAI_GPT3_ENGINE environment variable.

To reproduce experiments from EMNLP 2021 paper, please follow README_EMNLP_2021.md.

To use BenchCLAMP, please follow README_BenchCLAMP.md.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

semantic_parsing_with_constrained_lm's People

Contributors

hao-fang avatar microsoft-github-operations[bot] avatar microsoftopensource avatar rshin avatar sammthomson avatar sroy9 avatar

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.