Code Monkey home page Code Monkey logo

project-qa's Introduction

project-qa

A rule-based information extraction Python script to answer questions about sample stories

inspiration

Builds upon work done by Dr. Ellen Riloff in A Rule-based Question Answering System for Reading Comprehension Tests, with marginal improvements in precision and recall.

setup

Commands in included QA-script.txt should be run to install relevant packages and download spaCy corpus. Gensim relies on preconstructed word2vec vectors. These can be built from any sufficiently large corpus, but in this case I recommend the Google News dataset. They should be parsed into Gensim's KeyedVectors model and saved in ./data/training/word2vec.vectors.

approach

This script assigns a score to each sentence based on:

  • Distributional similarity of word embeddings
  • Named entity recognition
  • Sentence root identification

Then, attempts to filter the sentence down to relevant noun phrases or named entities. Detailed explanation contained in these slides

testing

This script is built to answer questions of any type given a relevant document. Sample input formats are shown in data/testset1. A scoring program has been included to output precision, recall, and F-score of produced answers.

performance

Running QA requires significant memory overhead as it loads w2v and spaCy corpus into memory before beginning. Afterwards reading and answering each story takes runtime on the order of one second, the majority of which is parsing the story into a spaCy nlp model. On a final test set of documents and questions, this system produced the following results:

  • RECALL = 0.5511
  • PRECISION = 0.3849
  • F-MEASURE = 0.4533

tools

Special thanks to Dr. Ellen Riloff at the University of Utah.

project-qa's People

Contributors

tnnrj avatar

Watchers

 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.