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

feat: add index parameter to TfidfRetriever #3666

Merged
merged 24 commits into from
Dec 19, 2022
Merged

feat: add index parameter to TfidfRetriever #3666

merged 24 commits into from
Dec 19, 2022

Conversation

anakin87
Copy link
Member

@anakin87 anakin87 commented Dec 4, 2022

Related Issues

Proposed Changes:

TfidfRetriever automatically uses the default index of the Document Store.
You can't set/change index, eg for evaluation purposes.

This PR is just a first draft to implement this feature by minimally changing the node.

How did you test it?

CI;
added a new (improvable) test.

Notes for the reviewer

  • assert isinstance(index, str) is necessary for mypy to not complain about the Optional nature of the index parameter
  • I also improved test_retrieval_without_filters to skip an unnecessary check

Checklist

@anakin87 anakin87 marked this pull request as ready for review December 4, 2022 22:37
@anakin87 anakin87 requested a review from a team as a code owner December 4, 2022 22:37
@anakin87 anakin87 requested review from masci and removed request for a team December 4, 2022 22:37
@anakin87
Copy link
Member Author

@ZanSara feel free to take a look 🙂

Copy link
Contributor

@ZanSara ZanSara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Left only a couple of comments

haystack/nodes/retriever/sparse.py Outdated Show resolved Hide resolved
haystack/nodes/retriever/sparse.py Outdated Show resolved Hide resolved
test/nodes/test_retriever.py Show resolved Hide resolved
test/nodes/test_retriever.py Outdated Show resolved Hide resolved
@masci masci requested review from ZanSara and removed request for masci December 12, 2022 10:20
Copy link
Contributor

@agnieszka-m agnieszka-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of language suggestions to align with our voice and tone :)

haystack/nodes/retriever/sparse.py Outdated Show resolved Hide resolved
haystack/nodes/retriever/sparse.py Outdated Show resolved Hide resolved
haystack/nodes/retriever/sparse.py Outdated Show resolved Hide resolved
haystack/nodes/retriever/sparse.py Outdated Show resolved Hide resolved
haystack/nodes/retriever/sparse.py Outdated Show resolved Hide resolved
haystack/nodes/retriever/sparse.py Outdated Show resolved Hide resolved
haystack/nodes/retriever/sparse.py Outdated Show resolved Hide resolved
haystack/nodes/retriever/sparse.py Outdated Show resolved Hide resolved
anakin87 and others added 7 commits December 13, 2022 10:25
Co-authored-by: Agnieszka Marzec <97166305+agnieszka-m@users.noreply.github.com>
Co-authored-by: Agnieszka Marzec <97166305+agnieszka-m@users.noreply.github.com>
Co-authored-by: Agnieszka Marzec <97166305+agnieszka-m@users.noreply.github.com>
Co-authored-by: Agnieszka Marzec <97166305+agnieszka-m@users.noreply.github.com>
Co-authored-by: Agnieszka Marzec <97166305+agnieszka-m@users.noreply.github.com>
Co-authored-by: Agnieszka Marzec <97166305+agnieszka-m@users.noreply.github.com>
@ZanSara ZanSara added type:feature New feature or request topic:retriever labels Dec 13, 2022
@anakin87 anakin87 requested review from agnieszka-m and removed request for ZanSara December 15, 2022 08:44
@anakin87 anakin87 requested review from ZanSara and removed request for agnieszka-m December 19, 2022 09:50
Copy link
Contributor

@ZanSara ZanSara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:retriever type:feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Add index parameter to TFiDF retriever
3 participants