0
votes

I want to train my Discovery collection where I have already uploaded over 200 documents. I uploaded these documents through the GUI. Looking through the Discovery documentation, I know that I have will have to make API calls to train my collection since the training API has not been exposed through the GUI yet. As part of the training API calls I need to include a document that looks like this:

{
  "natural_language_query": "{natural_language_query}",
  "filter": "{filter_definition}"
  "examples": [
    {
      "document_id": "{document_id_1}",
      "cross_reference": "{cross_reference_1}",
      "relevance": 0
    },
    {
      "document_id": "{document_id_2}",
      "cross_reference": "{cross_reference_2}",
      "relevance": 0
    }
  ]
}

My question is how should I get the documentIds for the documents that I have already uploaded? Is there a way to find this through the GUI? Or perhaps an API call that will return something like:

{
  "document_name" = "MyDocument1",
  "documentId" = "the_document_id_for_MyDocument1"
},

...

{
  "document_name" = "MyDocumentN",
  "documentId" = "the_document_id_for_MyDocumentN"
}

Or would the only way to get the documentIds would be to create a new collection and upload all of the documents through API calls directly and track the documentIds as I get them back?

1

1 Answers

0
votes

Using the GUI, perform the following steps:

  1. Input term(_id) in the "Group query results (Aggregation)" textbox.
  2. Under "Fields to return", select "Specify" to input extracted_metadata

Note, that query and filter inputs should remain empty