Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return more meta data & restructure reponse format #66

Merged
merged 2 commits into from
Apr 17, 2020
Merged

Conversation

tholor
Copy link
Member

@tholor tholor commented Apr 17, 2020

Let's return a bit more information from the Finder / in the API and adjust the response format:

  • offsets in the original doc (needed for feedback endpoint)
  • custom meta data (whatever is available in elasticsearch and is not excluded via excluded_meta_datain the ElasticsearchDocumentStore
  • move name into the meta field
{
    "results": [
        {
            "question": "Why did revenue increase?",
            "answers": [
                {
                    "answer": "Total revenue for the first quarter of 2017 was approximately $1,437,000,000",
                    "score": 3.589367151260376,
                    "probability": 0.6103231806375512,
                    "context": "<Some context>",
                    "offset_start": 212,
                    "offset_end": 288,
                    "offset_start_in_doc": 5674,
                    "offset_end_in_doc": 5750,
                    "document_id": "cqjbqnABdLrIEs4cBtTh",
                    "meta": {
                        "quarter": "Q1",
                        "year": "2017",
                        "company": "<Some Name>",
                        "name": "<Some File Name>.txt"
                    }
                },

…ge name for feedbackfield from answer_start to answer_doc_start.
@tholor tholor requested a review from tanaysoni April 17, 2020 16:09
@tholor tholor changed the title WIP Return more meta data & restructure reponse format Return more meta data & restructure reponse format Apr 17, 2020
@tholor tholor merged commit aafeb20 into master Apr 17, 2020
@julian-risch julian-risch deleted the return_meta_data branch November 15, 2021 07:07
masci pushed a commit that referenced this pull request Nov 27, 2023
Fix: slightly reorganize API docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants