concrete.search package¶
-
class
concrete.search.ttypes.
SearchCapability
(type=None, lang=None)¶ Bases:
object
A search provider describes its capabilities with a list of search type and language pairs.Attributes:- type: A type of search supported by the search provider- lang: Language that the search provider supports.Use ISO 639-2/T three letter codes.-
read
(iprot)¶
-
validate
()¶
-
write
(oprot)¶
-
-
class
concrete.search.ttypes.
SearchFeedback
¶ Bases:
object
Feedback values-
NEGATIVE
= -1¶
-
NONE
= 0¶
-
POSITIVE
= 1¶
-
-
class
concrete.search.ttypes.
SearchQuery
(terms=None, questions=None, communicationId=None, tokens=None, rawQuery=None, auths=None, userId=None, name=None, labels=None, type=None, lang=None, corpus=None, k=None, communication=None)¶ Bases:
object
Wrapper for information relevant to a (possibly structured) search.Attributes:- terms: Individual words, or multiword phrases, e.g., ‘dog’, ‘bluecheese’. It is the responsibility of the implementation ofSearch* to tokenize multiword phrases, if so-desired. Further,an implementation may choose to support advanced features such aswildcards, e.g.: ‘blue*’. This specification makes nocommittment as to the internal structure of keywords and theirsemantics: that is the responsibility of the individualimplementation.- questions: e.g., “what is the capital of spain?”questions is a list in order that possibly different phrasings ofthe question can be included, e.g.: “what is the name of spain’scapital?”- communicationId: Refers to an optional communication that can provide context for the query.- tokens: Refers to a sequence of tokens in the communication referenced by communicationId.- rawQuery: The input from the user provided in the search box, unmodified- auths: optional authorization mechanism- userId: Identifies the user who submitted the search query- name: Human readable name of the query.- labels: Properties of the query or user.These labels can be used to group queries and results by a domain or group ofusers for training. An example usage would be assigning the geographical regionas a label (“spain”). User labels could be based on organizational units (“hltcoe”).- type: This search is over this type of data (communications, sentences, entities)- lang: The language of the corpus that the user wants to search.Use ISO 639-2/T three letter codes.- corpus: An identifier of the corpus that the search is to be performed over.- k: The maximum number of candidates the search service should return.- communication: An optional communication used as context for the query.If both this field and communicationId is populated, then it isassumed the ID of the communication is the same as communicationId.-
read
(iprot)¶
-
validate
()¶
-
write
(oprot)¶
-
-
class
concrete.search.ttypes.
SearchResult
(uuid=None, searchQuery=None, searchResultItems=None, metadata=None, lang=None)¶ Bases:
object
Single wrapper for results from all the various Search* services.Attributes:- uuid: Unique identifier for the results of this search.- searchQuery: The query that led to this result.Useful for capturing feedback or building training data.- searchResultItems: The list is assumed sorted best to worst, which should bereflected by the values contained in the score field of eachSearchResult, if that field is populated.- metadata: The system that provided the response: likely use case forpopulating this field is for building training data. Presumablya system will not need/want to return this object in live use.- lang: The dominant language of the search results.Use ISO 639-2/T three letter codes.Search providers should set this when possible to support downstream processing.Do not set if it is not known.If multilingual, use the string “multilingual”.-
read
(iprot)¶
-
validate
()¶
-
write
(oprot)¶
-
-
class
concrete.search.ttypes.
SearchResultItem
(communicationId=None, sentenceId=None, score=None, tokens=None, entity=None)¶ Bases:
object
An individual element returned from a search. Most/all methodswill return a communicationId, possibly with an associated score.For example if the target element type of the search is Sentencethen the sentenceId field should be populated.Attributes:- communicationId- sentenceId: The UUID of the returned sentence, which appears in thecommunication referenced by communicationId.- score: Values are not restricted in range (e.g., do not have to bewithin [0,1]). Higher is better.- tokens: If SearchType=ENTITY_MENTIONS then this field should be populated.Otherwise, this field may be optionally populated in order toprovide a hint to the client as to where to center avisualization, or the extraction of context, etc.- entity: If SearchType=ENTITIES then this field should be populated.-
read
(iprot)¶
-
validate
()¶
-
write
(oprot)¶
-