SemanticSearch

This functionality requires an external account »

SemanticSearch[index,query]

finds the items similar to query inside index.

SemanticSearch[index,query,prop]

returns the specified property prop.

Details and Options

  • SemanticSearch performs a search on the semantic index using a query to find and retrieve similar text items.
  • The index is a SemanticSearchIndex[] expression or the name of a saved index.
  • Possible values for query include:
  • "query"a textual query (default)
    "query"fa query followed by a filtering operation
  • The input to the function f is the same tag specified when the index was created.
  • Possible values for prop include:
  • "Distance"distance between the encoded query and item
    "Item"items that match "query" (default)
    "ItemEmbedding"encoded item
    "Label"item label
    "Query"specified query
    "QueryEmbedding"encoded query
    "Source"item source
    "Tags"item tags
    {prop1,}a list of properties
    Allall the available properties for each item
  • The following options can be given:
  • MaxItems10how many items are returned
    ProgressReporting$ProgressReportingwhether to display progress information

Examples

open allclose all

Basic Examples  (1)

Create a SemanticSearchIndex:

Extract the most relevant quote from the Declaration of Independence:

Scope  (5)

Find the most semantically relevant matches in an index:

Get a list of available result properties:

Extract a specific result property:

Extract a list of properties:

Define an index with labeled sources:

The label is automatically returned when searching:

Return the item instead:

Define an index with tagged sources:

The tags are automatically returned when searching:

Filter for a specific tag value:

Wolfram Research (2024), SemanticSearch, Wolfram Language function, https://reference.wolfram.com/language/ref/SemanticSearch.html.

Text

Wolfram Research (2024), SemanticSearch, Wolfram Language function, https://reference.wolfram.com/language/ref/SemanticSearch.html.

CMS

Wolfram Language. 2024. "SemanticSearch." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SemanticSearch.html.

APA

Wolfram Language. (2024). SemanticSearch. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SemanticSearch.html

BibTeX

@misc{reference.wolfram_2024_semanticsearch, author="Wolfram Research", title="{SemanticSearch}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/SemanticSearch.html}", note=[Accessed: 05-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_semanticsearch, organization={Wolfram Research}, title={SemanticSearch}, year={2024}, url={https://reference.wolfram.com/language/ref/SemanticSearch.html}, note=[Accessed: 05-November-2024 ]}