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

Pipeline Extractor search; get multiple answers #633

Closed
hizzbizz opened this issue Jan 8, 2024 · 2 comments
Closed

Pipeline Extractor search; get multiple answers #633

hizzbizz opened this issue Jan 8, 2024 · 2 comments

Comments

@hizzbizz
Copy link

hizzbizz commented Jan 8, 2024

Searched google, docs, API, codebase, and thumbed through issues; could be maybe my vocab is off so apologies if this has already been answered.

First off, this is pretty amazing; I was able to use the pipeline package to get OpenAI to find stuff in my data; so cool, so easy.

However I'd like to return multiple results, with a confidence score. For my use case, just the top answer will not cut it.

I see there is something like that for the Embeddings type: https://github.com/neuml/txtai/blob/master/examples/13_Similarity_search_with_images.ipynb

However I don't see anything like that for the pipeline Extractor.

More concretely, is it possible to do something like this?

# Create and run extractor instance

extractor = Extractor(embeddings, llm, output="reference", ...)
results = extractor.search("I want a 15 inch laptop with 16gb and 1tb of storage") # <-- is there something like this 'search' method for pipeline package?

for result in results:
  print("ANSWER:", result["answer"]) 
  print("REFERENCE:", embeddings.search("select id, text from txtai where id = :id", parameters={"id": result["reference"]}))
@hizzbizz hizzbizz changed the title Extractor search; get multiple answers Pipeline Extractor search; get multiple answers Jan 8, 2024
@davidmezzetti
Copy link
Member

Hello, thank you for the write up and the kind words.

Regarding multiple extractor answers, this is a known issue: #406

It's something I do hope to work on in the near future.

@hizzbizz
Copy link
Author

hizzbizz commented Jan 8, 2024

Totally understand! I look forward to the future - And thank you so much for the work that's already here - brought a lot of joy to my AI/LLM experiments!

@hizzbizz hizzbizz closed this as completed Jan 8, 2024
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

2 participants