Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Update documentation

davidmezzettide15603ce316
diff --git a/src/python/txtai/api/routers/labels.py b/src/python/txtai/api/routers/labels.py
index 568b7bfd..057ba940 100644
--- a/src/python/txtai/api/routers/labels.py
+++ b/src/python/txtai/api/routers/labels.py
@@ -16,9 +16,11 @@ def label(text: str = Body(...), labels: List[str] = Body(...)):
"""
Applies a zero shot classifier to text using a list of labels. Returns a list of
{id: value, score: value} sorted by highest score, where id is the index in labels.
+
Args:
text: input text
labels: list of labels
+
Returns:
list of {id: value, score: value} per text element
"""
@@ -32,9 +34,11 @@ def batchlabel(texts: List[str] = Body(...), labels: List[str] = Body(...)):
Applies a zero shot classifier to list of text using a list of labels. Returns a list of
{id: value, score: value} sorted by highest score, where id is the index in labels per
text element.
+
Args:
texts: list of text
labels: list of labels
+
Returns:
list of {id: value score: value} per text element
"""
diff --git a/src/python/txtai/api/routers/segmentation.py b/src/python/txtai/api/routers/segmentation.py
index 778355e7..37ef3fcd 100644
--- a/src/python/txtai/api/routers/segmentation.py
+++ b/src/python/txtai/api/routers/segmentation.py
@@ -14,7 +14,7 @@ router = APIRouter()
@router.get("/segment")
def segment(text: str):
"""
- Segments input text.
+ Segments text into semantic units.
Args:
text: input text
@@ -29,10 +29,10 @@ def segment(text: str):
@router.post("/batchsegment")
def batchsegment(texts: List[str] = Body(...)):
"""
- Extracts text from a file at path.
+ Segments text into semantic units.
Args:
- text: list of texts to segment
+ texts: list of texts to segment
Returns:
list of segmented text
diff --git a/src/python/txtai/api/routers/transcription.py b/src/python/txtai/api/routers/transcription.py
index e187590b..4e1f5747 100644
--- a/src/python/txtai/api/routers/transcription.py
+++ b/src/python/txtai/api/routers/transcription.py
@@ -20,7 +20,7 @@ def transcribe(file: str):
file: file to transcribe
Returns:
- list of transcribed text
+ transcribed text
"""
return application.get().pipeline("transcription", (file,))
@@ -32,7 +32,7 @@ def batchtranscribe(files: List[str] = Body(...)):
Transcribes audio files to text.
Args:
- file: list of files to transcribe
+ files: list of files to transcribe
Returns:
list of transcribed text