feat(primitive/faiss.py): support HNSW and reverted indexer #387
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Result
Query: "中秆早和原丰早,有啥区别?"
After
reverted-indexer gives more candidates
![image](https://private-user-images.githubusercontent.com/7872421/369305906-4a39087e-eed0-4bf3-8e63-31f40f94ab48.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2ODgwNDQsIm5iZiI6MTczOTY4Nzc0NCwicGF0aCI6Ii83ODcyNDIxLzM2OTMwNTkwNi00YTM5MDg3ZS1lZWQwLTRiZjMtOGU2My0zMWY0MGY5NGFiNDgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMDYzNTQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzIwMDdjYzcwYTE0MmYyNDhiNDJmNDEyOWIyZjJjNDliNTU5ZGYyZDRiN2RhMWQ4OTBjODliZmViZjI4ZTYzMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.quT1T476iAtcM1ydzVK0Mguytf_hWZh7PSK4Vlr2gcw)
Usage
words.txt
words.txt
After finish, there is a
![image](https://private-user-images.githubusercontent.com/7872421/368960379-43ee396d-1186-420a-9d79-4238d579493d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2ODgwNDQsIm5iZiI6MTczOTY4Nzc0NCwicGF0aCI6Ii83ODcyNDIxLzM2ODk2MDM3OS00M2VlMzk2ZC0xMTg2LTQyMGEtOWQ3OS00MjM4ZDU3OTQ5M2QucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTZUMDYzNTQ0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTVkYmFiYTQ2YTE0YTg0NzcwODNmZTI1YTIwNmJiNTYzNjdjN2Q0N2ZjNGU1NTQ3NWNlMjc2Nzk1MmQ5ZTg4NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.YNx-sZjFMDnOGPQL92OI55vP0D5LyscMzDxLe8NzT3g)
db_reverted_index
in yourworkdir