Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Thilina Rajapakse committed Jan 31, 2024
1 parent a42746e commit c76df2c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.65.0] - 2025-01-31

- Lots of QOL improvements
- Added support for evaluating retrieval models with `pytrec_eval`
- Added support for clustered training with `RetrievalModel`


## [0.64.0] - 2023-04-24

Expand Down
13 changes: 13 additions & 0 deletions docs/_docs/55-retrieval-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ model = RetrievalModel(
| retrieve_n_docs | int | 10 | Number of documents to be retrieved when doing retrieval tasks (e.g. `evaluate_model()`, `predict()`) |
| save_passage_dataset | bool | True | Save passage datasets (during evaluation and prediction) to disk. |
| use_hf_datasets | bool | True | Use Huggingface Datasets for lazy loading of data. Must be set to True for `RetrievalModel`. |
| tie_encoders | bool | False | Whether to tie the weights of the context encoder and query encoder. |
| train_context_encoder | bool | True | Whether to train the context encoder. |
| train_query_encoder | bool | True | Whether to train the query encoder. |
| mean_pooling | bool | False | Whether to use mean pooling when generating representations. |
| cluster_every_n_epochs | int | 1 | Perform a clustering step every `n` epochs |




**Note:** For configuration options common to all Simple Transformers models, please refer to the [Configuring a Simple Transformers Model section](/docs/usage/#configuring-a-simple-transformers-model).
Expand Down Expand Up @@ -187,6 +194,8 @@ Trains the model using 'train_data'
* **additional_eval_passages** *(optional)* - Additional passages to be used during evaluation.
This may be a list of passages, a pandas DataFrame with the column `passages`, or a TSV file with the column `passages`.

* **clustered_training** *(`bool`, optional)* - Whether to use clustered training. If True, the model will be trained with hard negatives obtained by clustering passages or queries.

* **kwargs** *(optional)* - Additional metrics that should be calculated. Pass in the metrics as keyword arguments *(name of metric: function to calculate metric)*. Refer to the [additional metrics](/docs/tips-and-tricks/#additional-evaluation-metrics) section.
E.g. `f1=sklearn.metrics.f1_score`.
A metric function should take in two parameters. The first parameter will be the true labels, and the second parameter will be the predictions.
Expand Down Expand Up @@ -270,6 +279,10 @@ A metric function should take in two parameters. The first parameter will be the
{: .return-list}


**Note:** Simple Transformers can now evaluate retrieval models with `pytrec_eval`. To use this, you must install `pytrec_eval` using `pip install pytrec_eval`. In order to use `pytrec_eval`, you must provide a path to a directory containing a dataset in BEIR or MS MARCO format as `eval_data`.
{: .notice--info}


**Note:** For more details on evaluating models with Simple Transformers, please refer to the [Tips and Tricks](/docs/tips-and-tricks) section.
{: .notice--info}

Expand Down
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@

setup(
name="simpletransformers",
<<<<<<< HEAD
version="0.64.4",
=======
version="0.64.5",
>>>>>>> master
version="0.65.0",
author="Thilina Rajapakse",
author_email="[email protected]",
description="An easy-to-use wrapper library for the Transformers library.",
Expand Down

0 comments on commit c76df2c

Please sign in to comment.