Build a model that answers question from dataset using GPT3

1.9k views Asked by At

I am trying to build a chat bot, that given some text corpus, will answer questions when we ask something from that text. I have heard GPT3 is a beast and requires minimum training. Are there any links/ tutorial/github repo's that will help me get started with this?

1

There are 1 answers

3
J. M. Arnold On BEST ANSWER

Sure, if you got a beta access to the OpenAI GPT-3 API you're easily able to do so. In case you don't, you can apply for it - you should get accepted fairly quickly (in my specific case it took about 24 hours).

Depending whether you look for speed or precision you should choose between Davinci, Cushman or Curie (list of engines), whereas Davinci is the best (precision-wise).

You can use the Playground to enter a text corpus and a question - here is an example: Example picture I used davinci-instruct-beta with a temperature of 0.25 and response length of 10. A pretty basic setup.

For demonstration purposes, here is the API request made via Python. response returns "Anna hates doing research the most."

import openai

openai.api_key = 'KEY'

response = openai.Completion.create(
  engine="davinci-instruct-beta",
  prompt="Anna loves programming in Python and C++, though she absolutely despises doing research.\nWhat does Anna hate the most?\n\nAnna hates doing research the most.Example",
  temperature=0.25,
  max_tokens=10,
  top_p=1
)