Search Results¶
Looping through search.limit_documents(n) will yield document objects of type
Document
.
id
: The unique identifier of the document, a 32-character hexadecimal string.headline
: The title of the document.url
: The URL of the original document.sentiment
: A score between -1.0 and +1.0 that represents the document-level sentiment.source
: The source of the document, an instance ofSource
, which contains the key and name of the source, and its Rank.timestamp
: The timestamp of the document, a datetime object.chunks
: The content of the document, as a list ofDocumentChunk
.language
: The language of the document, an instance ofLanguage
.
As for “chunks”, each DocumentChunk
object has
the following attributes:
text
: The text of the chunk.chunk
: The index of the chunk in the document, zero-based. You can use it to sort them in order.entities
: A list of entities detected in the chunk, each entity is an instance ofDocumentSentenceEntity
and contains the entity key as well as the position in the text where it’s detected. Note that these entity objects can’t be used to create queries for searches.sentences
: A list of sentences detected in the chunk, each sentence is an instance ofDocumentSentence
and contains only the number of paragraph and sentence.relevance
: A float bigger or equal to 0. Relevance indicates the degree to which a particular match aligns with the various terms in your query. It’s important to note that the relevance scores you receive are only meaningful within the context of the same search. Each execution generates unique scores, so comparing relevance across different queries is not meaningful.sentiment
: A score between -1.0 and +1.0 that represents the chunk-level sentiment.
Document
Example:
id='AFD7D4CEF60C09D16BC671BB2047A889',
headline='Ascendant Resources appoints McGovern Hurley as auditor',
url='https://your_source_url.com/some_document',
sentiment=-0.07,
source=DocumentSource(
key='B5235B',
name='The Fly',
rank=1),
timestamp=datetime.datetime(2024, 6, 26, 16, 15, 46, tzinfo=datetime.timezone.utc),
chunks=[
DocumentChunk(
text="""Ascendant Resources announced that it has appointed McGovern Hurley LLP
as its auditor until the next meeting of shareholders. The appointment of
McGovern Hurley follows mutual agreement between Ascendant and KPMG LLP and
the subsequent notice from KPMG LLP to resign as auditor of the Company.""",
chunk=1,
entities=[
DocumentSentenceEntity(
key='business,regulatory,auditor-appointment,,',
start=0,
end=19,
query_type=<QueryType.TOPIC: 'rp_topic'>),
DocumentSentenceEntity(
key='business,regulatory,auditor-appointment,,',
start=195,
end=204,
query_type=<QueryType.TOPIC: 'rp_topic'>),
DocumentSentenceEntity(
key='business,regulatory,auditor-resignation,,',
start=209,
end=217,
query_type=<QueryType.TOPIC: 'rp_topic'>),
DocumentSentenceEntity(
key='business,regulatory,auditor-resignation,,',
start=249,
end=257,
query_type=<QueryType.TOPIC: 'rp_topic'>),
DocumentSentenceEntity(
key='4544EB',
start=209,
end=217,
query_type=<QueryType.ENTITY: 'entity'>)],
sentences=[
DocumentSentence(paragraph=1, sentence=1),
DocumentSentence(paragraph=1, sentence=2)],
relevance=8.871622868175674,
sentiment=-0.07,
...
language='English',
...