Analyze
Download

Download

Preview result of an analysis previously run.

POST
https://api.textreveal.com/api/2.0/analyze/download
  • If you use the sort parameter, the date parameter can become mandatory if your analysis has generated a certain amount of results (2 500 000 documents).
  • When the sort parameter is applied to a field that has aggregation functions (e.g., min, max, median, mean), sorting will be based on the mean value.
  • When using one of the entity match field (document_entity_polarity, document_entity_positive, document_entity_neutral, document_entity_negative) in the sort parameter, the entity parameter is mandatory.
  • premium_news text cannot be retrieved. If the document comes from premium_news, each sentence will be replaced by this placeholder The download of licensed text is not allowed.
  • The summary field is an experimental feature, we recommend to use the /documents route with the document id, as seen in the example page here
  • Certain fields (like id, title, sentences, url or thread) are only returned if the total number of documents (the “computed limit”) is ≤ 2000.

Request

Parameters

  • json_linesboolean

    Set to true to download result in json lines format.

Request Body

  • conceptstring

    Detected concept in the documents. This concept must be part of the instance.

    Example: "pollution"
  • datedate

    Extract date of the documents. Must be within the instance's date range.

    Example: "2019-02-01"
  • entitystring

    Detected entity in the documents. This entity must be part of the instance.

    Example: "sesamm"
  • fields(string (enum))[]

    List of fields to be extracted in documents.

    Values: "concepts", "document_entity_negative", "document_entity_neutral", "document_entity_polarity", "document_entity_positive", "document_negative", "document_neutral", "document_polarity", "document_positive", "entities", "extract_date", "id", "language", "mentions", "qscore", "sentences", "thread", "title", "url", "summary"
  • instance*uuid

    The identifier of an analysis. This identifier have to be used to get results.

    Example: "a62caf56-5961-4fff-ba2e-6d4dcf98960f"
  • limit*integer | object
  • sortobject
Request
{
  "concept": "pollution",
  "date": "2019-02-01",
  "entity": "sesamm",
  "fields": [
    "title"
  ],
  "instance": "a62caf56-5961-4fff-ba2e-6d4dcf98960f",
  "limit": 500,
  "sort": {
    "field": "document_polarity",
    "order": "ASC"
  }
}

Response

Response - 200

An array with the analysis results

  • []array
Response
[
  {
    "concepts": {},
    "document_entity_negative": {
      "apple": {
        "max": 0.9670407,
        "mean": 0.497277776,
        "median": 0.40673238,
        "min": 0.17257427
      }
    },
    "document_entity_neutral": {
      "apple": {
        "max": 0.5155762,
        "mean": 0.285450036,
        "median": 0.310295895,
        "min": 0.0075512277
      }
    },
    "document_entity_polarity": {
      "apple": -0.39186285999393844
    },
    "document_entity_positive": {
      "apple": {
        "max": 0.31184947,
        "mean": 0.217272184,
        "median": 0.28185567,
        "min": 0.025408149
      }
    },
    "document_negative": {
      "max": 0.9670407,
      "mean": 0.47984254066667,
      "median": 0.42040768,
      "min": 0.044773154
    },
    "document_neutral": {
      "max": 0.52536553,
      "mean": 0.26162332989048,
      "median": 0.28505275,
      "min": 0.0075512277
    },
    "document_polarity": -0.29972293,
    "document_positive": {
      "max": 0.6805551,
      "mean": 0.25853412119048,
      "median": 0.28185567,
      "min": 0.025408149
    },
    "entities": {
      "{id}": [
        {
          "{label}": 1
        }
      ]
    },
    "extract_date": "2019-01-31T05:46:28.011+02:00",
    "id": "UBz9o2wBVJ4dixtoXYUM",
    "language": "english",
    "mentions": {
      "{id}": {
        "{label}": 1
      }
    },
    "qscore": 96.05063600458071,
    "sentences": [
      {
        "entities": [
          "Q312"
        ],
        "matches": [
          {
            "class": "mentions",
            "count": {
              "keyword": 1
            },
            "entity_id": "Q312",
            "similarity": 0.818992972373962
          }
        ],
        "results": {
          "anger": 0,
          "anticipation": 0.95,
          "fear": 0,
          "joy": 4.7,
          "negative": 0.22,
          "neutral": 0.41,
          "polarity": 0.32,
          "polarity_exp": 0.56,
          "positive": 0.35,
          "sadness": 0,
          "surprise": 0.25,
          "trust": 8.8
        },
        "sentence_id": 0,
        "text": "Airbus, which has some 130,000 employees worldwide, and Boeing are the world's leading airplane makers.",
        "type": 0
      }
    ],
    "thread": {
      "country": "US",
      "site": "indiatimes.com",
      "site_type": "news"
    },
    "title": "Hundreds of Apple iPhone X, iPhone XS users want to remove this button from the main lock screen - Gadgets Now",
    "url": "https://timesofindia.indiatimes.com/t10-jan-31-2019/8-can-apple-be-more-than-an-iphone-maker/articleshow/67759767.cms"
  }
]

Response - 202

The instance is still in progress. Retry later.

Response - 204

No content. The instance has been stopped or an error occured within the instance.