STRIVE: Semantic Tokenized Ranking via Vectorization & Embeddings
from strive.reranker import Reranker, EmbeddingType, deduplicate_results
textual_reranker = Reranker(embedding_type=EmbeddingType.textual)
semantic_reranker = Reranker(embedding_type=EmbeddingType.semantic)
# Supports English and Portuguese
corpus = [
"O presidente anunciou novas políticas econômicas.",
"Houve exonerações no governo recentemente.",
"Os nomes dos exonerados ainda não foram divulgados.",
"O mercado financeiro reagiu positivamente às mudanças.",
"O congresso discutirá reformas tributárias esta semana."
]
query = "danças" # parte de "mudanças"
# Build the index with the given corpus
textual_results = textual_reranker.rerank_documents(query, corpus, top_k=len(corpus))
semantic_results = semantic_reranker.rerank_documents(query, corpus, top_k=len(corpus))
merged_results = textual_results + semantic_results
# Deduplicate the results
deduplicated_results = deduplicate_results(merged_results, top_k=2)
print(deduplicated_results)
# [('O mercado financeiro reagiu positivamente às mudanças.', 0.7980238199234009), ('O presidente anunciou novas políticas econômicas.', 0.37016284745050076)]
Metadata
Release files for strive-ranker 2.42
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| strive_ranker-2.42.tar.gz | 48.7 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| strive_ranker-2.42-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 97.5 MB
Release files / strive_ranker-2.42.tar.gz
| Download URL | strive_ranker-2.42.tar.gz |
|---|---|
| Size | 48.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
91c8475cd4f618ac6fc8173ac7794eb8237eac7c44996c37fbb39734d9a2b56d
|
|
BLAKE2b-256 checksum How to use checksums |
dafd6a420da5d2f10c3a84f1112bbd317d391f40382d3fae33a37690d5942f6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Release files / strive_ranker-2.42-py3-none-any.whl
| Download URL | strive_ranker-2.42-py3-none-any.whl |
|---|---|
| Size | 48.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0179f54fdc9999c2033a93bcf396708212ece5851174077b7ffd374064268a2a
|
|
BLAKE2b-256 checksum How to use checksums |
9c13faaac977f10b58b789b9f7be5fd50bcf0baf7bfb85cdb48ce131a508a7a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Security for strive-ranker 2.42
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.