Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New API #30

Closed
koaning opened this issue Dec 14, 2022 · 0 comments
Closed

New API #30

koaning opened this issue Dec 14, 2022 · 0 comments

Comments

@koaning
Copy link
Owner

koaning commented Dec 14, 2022

I think the original design was flawed and this project should stick to the scikit-learn API more.

from simsity.preprocessing import Grab
from simsity.service import Service
from simsity.indexer import (AnnoyIndexer, PynnDescentIndexed, NMSlibIndexer,
                             PineconeIndexer, QdrantIndexer, WeviateIndexer)


encoder = make_pipeline(
    make_union(
        make_pipeline(Grab("text"), SentenceEncoder()),
        make_pipeline(Grab("title"), SentenceEncoder())
    )
)

service = Service(encoder, indexer, batch_size=50)
service.index(X)
items, dists = service.query(X, n=10)
@koaning koaning closed this as completed Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant