Coder Social home page Coder Social logo

Comments (2)

tomhosking avatar tomhosking commented on July 24, 2024

I think this should do the trick:

{
  'queries': [
    ['This is document 1', 'document 1', 8],
    ['This is document 2', '2', 17],
    ....
  ]
}

The relevant part of the api is here - you could probably refactor this to be less awful if you wanted! Basically ctxts, ans, ans_pos are all lists of documents, answers, and answer character offsets.

from question-generation.

Phirefly9 avatar Phirefly9 commented on July 24, 2024

perfect thanks, to anyone else looking for a quick minimal code

import requests

data = {"queries": [
    ["The Normans were the people who in the 10th and 11th centuries gave their name to Normandy, a region in France.", "Normans", 4],
]}

r = requests.post("http://<IP>:5004/api/generate_batch", json=data)
print(r.json())
>>> {'status': 'OK', 'results': [{'q': "what were the people who 's name to normandy ? &lt;/Sent&gt;", 'a': 'Normans'}]}

from question-generation.

Related Issues (20)

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.