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

ADD : bm25 #37

Merged
merged 3 commits into from
Oct 21, 2021
Merged

ADD : bm25 #37

merged 3 commits into from
Oct 21, 2021

Conversation

goattier
Copy link
Contributor

retrieval_bm25.py 추가.

pip install rank_bm25

inference.py -> run_sparse_retireval에서 SparseRetrieval 대신 사용하시면 됩니다.

Comment on lines 84 to 88
self.bm25 = BM25Okapi(self.contexts, tokenizer=self.tokenize_fn, k1=1.2, b=0.75)
tokenized_contexts = [self.tokenize_fn(c) for c in self.contexts]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

multiprocess pool 로 tokenizing 시 발생되는 issue로 인해 list comprehension으로 변경
[22secs -> 84secs]
-> bin파일 load로 개선

@CozyKim CozyKim merged commit 48b7136 into develop Oct 21, 2021
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

Successfully merging this pull request may close these issues.

2 participants