GithubHelp home page GithubHelp logo

camoverride / question_answering Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 152 KB

question answering using data from Wikipedia ๐Ÿค”

Home Page: https://camtsmith.com/articles/2021-04/question-answering-with-bert

Python 99.25% Dockerfile 0.75%
bert bert-model information-retrieval question-answering wikipedia

question_answering's People

Contributors

camoverride avatar

Watchers

 avatar  avatar  avatar

question_answering's Issues

chores

  • confirm that BERT-SQUAD is fine-tuned on wikipedia!
  • check out huggingface models for a smaller model -- might have to fine-tine this
  • investigate wiki's native elasticsearch engine
  • find cheap method for calling BERT's tokenizer instead of my whitespace split (TODO)
  • chunk articles with overlap in case answer lies at the boundary (this is unlikely though) (TODO)
  • find better decision criteria than simply sum of the max from start/end tensors. (TODO)

put tokenizer on model server

put the tokenizer on model server (doc) and then:

  • modify Answerer._get_tokens so that it uses BERT tokenizer instead of whitespace tokenization
  • chunk articles with overlap in case answer lies at the boundary (this is unlikely though)
  • warm up tokenizer model and BERT model

allow independent model server

Code should be run like this

from question_answering import Answerer

# Gives a lot of info
ans = answerer.answer_question("What is the population of Canada?")

# Parse it
ans["answer"]["answer"]

However, there should be several options for configuring this locally:

    1. it's a python package that you pip install. Large model is downloaded and is spun up/town down at every request. This is simple but slow.
    1. It's a python package that you pip install. BUT you then launch a model server locally that runs in the background.
    1. It's a python package that you pip install. You run the model server in the background. Also, you download wikipedia and query that locally instead of going over the web - this is 80 gigs of data!

This is how a model server should be configured, after the docker model server is running:

# Import QA without loading the model into memory.
import question_answering as qa
qa.config("model_address" = "localhost:4000")

# Gives a lot of info
ans = qa.Answerer().answer_question("What is the population of Canada?")

# Parse it
ans["answer"]["answer"]

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.