Update docs

This commit is contained in:
davidmezzetti
2021-01-11 21:32:00 -05:00
parent 31114a860c
commit b6afdfde59
4 changed files with 14 additions and 14 deletions
+8 -8
View File
@@ -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)
+2 -2
View File
@@ -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:
+2 -2
View File
@@ -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)
+2 -2
View File
@@ -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,