From b6afdfde591131e296ebd540319f50f3eee5ec5b Mon Sep 17 00:00:00 2001 From: davidmezzetti <561939+davidmezzetti@users.noreply.github.com> Date: Mon, 11 Jan 2021 21:32:00 -0500 Subject: [PATCH] Update docs --- src/python/txtai/api.py | 16 ++++++++-------- src/python/txtai/embeddings.py | 4 ++-- src/python/txtai/extractor.py | 4 ++-- src/python/txtai/pipeline.py | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/python/txtai/api.py b/src/python/txtai/api.py index bd33c18c..23feeccd 100644 --- a/src/python/txtai/api.py +++ b/src/python/txtai/api.py @@ -188,7 +188,7 @@ class API(object): def similarity(self, query, texts): """ - Computes the similarity between query and list of strings. Returns a list of + Computes the similarity between query and list of text. Returns a list of (id, score) sorted by highest score, where id is the index in texts. Args: @@ -209,7 +209,7 @@ class API(object): def batchsimilarity(self, queries, texts): """ - Computes the similarity between list of queries and list of strings. Returns a list + Computes the similarity between list of queries and list of text. Returns a list of (id, score) sorted by highest score per query, where id is the index in texts. Args: @@ -233,7 +233,7 @@ class API(object): Transforms list of texts into embeddings arrays. Args: - texts: list of strings + texts: list of text Returns: embeddings arrays @@ -250,7 +250,7 @@ class API(object): Args: queue: list of {name: value, query: value, question: value, snippet: value} - texts: list of strings + texts: list of text Returns: list of (name, answer) @@ -381,7 +381,7 @@ def index(): @app.post("/similarity") def similarity(query: str = Body(...), texts: List[str] = Body(...)): """ - Computes the similarity between query and list of strings. Returns a list of + Computes the similarity between query and list of text. Returns a list of (id, score) sorted by highest score, where id is the index in texts. Args: @@ -397,7 +397,7 @@ def similarity(query: str = Body(...), texts: List[str] = Body(...)): @app.post("/batchsimilarity") def batchsimilarity(queries: List[str] = Body(...), texts: List[str] = Body(...)): """ - Computes the similarity between list of queries and list of strings. Returns a list + Computes the similarity between list of queries and list of text. Returns a list of (id, score) sorted by highest score per query, where id is the index in texts. Args: @@ -430,7 +430,7 @@ def batchembeddings(texts: List[str] = Body(...)): Transforms list of text into embeddings arrays. Args: - texts: list of strings + texts: list of text Returns: embeddings arrays @@ -445,7 +445,7 @@ def extract(queue: List[dict] = Body(...), texts: List[str] = Body(...)): Args: queue: list of {name: value, query: value, question: value, snippet: value) - texts: list of strings + texts: list of text Returns: list of (name, answer) diff --git a/src/python/txtai/embeddings.py b/src/python/txtai/embeddings.py index fb5ab4fa..dba18a6b 100644 --- a/src/python/txtai/embeddings.py +++ b/src/python/txtai/embeddings.py @@ -233,7 +233,7 @@ class Embeddings(object): def similarity(self, query, texts): """ - Computes the similarity between query and list of strings. Returns a list of + Computes the similarity between query and list of text. Returns a list of (id, score) sorted by highest score, where id is the index in texts. Args: @@ -248,7 +248,7 @@ class Embeddings(object): def batchsimilarity(self, queries, texts): """ - Computes the similarity between list of queries and list of strings. Returns a list + Computes the similarity between list of queries and list of text. Returns a list of (id, score) sorted by highest score per query, where id is the index in texts. Args: diff --git a/src/python/txtai/extractor.py b/src/python/txtai/extractor.py index 5d293750..885a1bbf 100644 --- a/src/python/txtai/extractor.py +++ b/src/python/txtai/extractor.py @@ -42,7 +42,7 @@ class Extractor(object): Args: queue: input queue (name, query, question, snippet) - texts: list of strings + texts: list of text Returns: list of (name, answer) @@ -72,7 +72,7 @@ class Extractor(object): Args: queries: list of embedding queries to run - texts: list of strings + texts: list of text Returns: list of (id, text, score) diff --git a/src/python/txtai/pipeline.py b/src/python/txtai/pipeline.py index 8a9f54a3..4a2b1c52 100644 --- a/src/python/txtai/pipeline.py +++ b/src/python/txtai/pipeline.py @@ -123,12 +123,12 @@ class Labels(Pipeline): class Similarity(Labels): """ - Computes similarity between query and list of strings using a zero shot classifier. + Computes similarity between query and list of text using a zero shot classifier. """ def __call__(self, query, texts, multiclass=True): """ - Computes the similarity between query and list of strings. Returns a list of + Computes the similarity between query and list of text. Returns a list of (id, score) sorted by highest score, where id is the index in texts. This method supports query as a string or a list. If the input is a string,