Downloads · 30 days
14
0% of all-time downloads
enelpol/czywiesz-context
czywiesz-context is a feature extraction model from enelpol. Use it when you need embeddings to search or compare text. It is set up for transformers.
The model was created for selective question answering in Polish. I.e. it is used to find passages containing the answers to the given question.
Downloads · 30 days
14
0% of all-time downloads
All-time downloads
4.2K
Public
Repo size
1.5 GB
Likes
3
Public
Click a slice to open those files.
.bin498 MB · 100%
From the Hugging Face model README
The model was created for selective question answering in Polish. I.e. it is used to find passages containing the answers to the given question.
It is used to encode the contexts (aka passages) in the DPR bi-encoder architecture. The architecture requires two separate models. The question part has to be encoded with the corresponding question encoder.
The model was created by fine-tuning Herbert base cased on "Czywiesz" dataset. Czywiesz dataset contains questions and Wikipedia articles extracted from the Polish Wikipedia.
It is the easiest to use the model with the Haystack framework.
from haystack.document_stores import FAISSDocumentStore
from haystack.retriever import DensePassageRetriever
document_store = FAISSDocumentStore(faiss_index_factory_str="Flat")
retriever = DensePassageRetriever(
document_store=document_store,
query_embedding_model="enelpol/czywiesz-question",
passage_embedding_model="enelpol/czywiesz-context"
)
for document in documents:
document_store.write_documents([document])
document_store.update_embeddings(retriever)
document_store.save("contexts.faiss")