Usługa przetwarzająca dokumenty do wektorów osadzeń za pomocą Sentence Transformers.
Domyślnie wykorzystuje wielojęzykowy model distiluse-base-multilingual-cased-v2, który obsługuje ponad 50 języków i jest destylowaną wersją modelu mUSE.
any2txt|dir|sentencembeddings
Plik zip zawierający pliki tekstowe np. txt
, docx
.
Plik w formacie json o strukturze:
{
nazwa_pliku: {
text: tekst,
embedding: wektor osadzeń
}
...
}
np.
{
"1": {
"text": "Ala ma kota",
"embedding": [
-0.016188109293580055,
-0.03458140417933464,
-0.019875766709446907,
...
]
},
"2": {
"text": "Ala ma psa",
"embedding": [
0.007478876505047083,
-0.024507928639650345,
-0.0030518441926687956,
...
]
}
}
from lpmn_client import download_file, upload_file
from lpmn_client import Task
task = Task(lpmn='any2txt|dir|sentencembeddings')
task.email = "example@mail.com" # change e-mail
file_id = upload_file("./test.zip") # zip file with some documents (for example docx files)
output_file_id = task.run(file_id)
download_file(output_file_id, "./out")
(C) CLARIN-PL