Downloads · 30 days
11
42% of all-time downloads
BehnamAxo/pytorch-conversational-memory-reranker
pytorch-conversational-memory-reranker is a text classification model from BehnamAxo. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
This is a small educational cross-encoder that scores whether a candidate conversational memory is relevant to a query. It demonstrates the complete PyTorch and Hugging Face workflow; it is not a production model.
Downloads · 30 days
11
42% of all-time downloads
All-time downloads
26
Public
Parameters
4.4M
17.5 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors17.5 MB · 96%
From the Hugging Face model README
This is a small educational cross-encoder that scores whether a candidate conversational memory is relevant to a query. It demonstrates the complete PyTorch and Hugging Face workflow; it is not a production model.
BertForSequenceClassification with one output logitgoogle/bert_uncased_L-2_H-128_A-2The inference example also applies sigmoid. Because the dataset is extremely small, that value is not a calibrated probability or reliable confidence score.
Do not use this model for production retrieval, safety-critical decisions, medical, legal, financial, employment, surveillance, identity, or access-control decisions. Do not use it to infer sensitive personal attributes. It has not been evaluated for languages other than English.
The dataset contains 50 entirely synthetic query-candidate examples organized into 10 query groups. Each group contains relevant, easy-negative, and hard-negative candidates. No real conversations, private data, patient data, company data, or user identifiers were used.
Query groups were split 60/20/20 into training, validation, and test data. The
transformer was fine-tuned for four epochs with AdamW, a learning rate of
5e-5, and binary cross-entropy with logits. Epoch 2 was selected using
validation MRR and nDCG.
| System | Test MRR | Test nDCG |
|---|---|---|
| Existing retrieval order | 1.0000 | 1.0000 |
| Simple bag-of-words reranker | 0.7500 | 0.7853 |
| This transformer cross-encoder | 0.7500 | 0.7506 |
The transformer did not outperform either baseline. These results cover only two synthetic test-query groups and do not establish general model quality.
Development-machine inference measured roughly 1.4 ms per pair and about 16.8 MiB for parameters and evaluated tensors. Timing varies by hardware and workload.
python -m pip install -r requirements.txt
python inference.py . "What affects the user's sleep?" "Coffee keeps the user awake."
The script loads local package files and prints logit and probability fields.
The fine-tuning data is synthetic and contains no secrets or real personal data. The package contains model weights, public tokenizer files, configuration, documentation, and inference code only. Users must not supply data they are not authorized to process and should apply their own privacy controls.
This fine-tuned model is released under the Apache License 2.0, matching the license declared by the base model.