Skip to content

Commit d6ea029

Browse files
authored
Make minor updates to docs (#3285)
1 parent a675780 commit d6ea029

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

docs/cross_encoder/usage/usage.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Once you have `installed <../../installation.html>`_ Sentence Transformers, you
1818
3. :meth:`CrossEncoder.rank <sentence_transformers.cross_encoder.CrossEncoder.rank>`
1919

2020
.. note::
21-
MS Marco models return logits rather than scores between 0 and 1. Load the :class:`~sentence_transformers.cross_encoder.CrossEncoder` with ``default_activation_function=torch.nn.Sigmoid()`` to get scores between 0 and 1. This does not affect the ranking.
21+
MS Marco models return logits rather than scores between 0 and 1. Load the :class:`~sentence_transformers.cross_encoder.CrossEncoder` with ``activation_fn=torch.nn.Sigmoid()`` to get scores between 0 and 1. This does not affect the ranking.
2222

2323
::
2424

@@ -72,4 +72,5 @@ Once you have `installed <../../installation.html>`_ Sentence Transformers, you
7272
:maxdepth: 1
7373
:caption: Tasks
7474

75-
../../../examples/sentence_transformer/applications/retrieve_rerank/README
75+
Cross-Encoder vs Bi-Encoder <../../../examples/cross_encoder/applications/README>
76+
../../../examples/sentence_transformer/applications/retrieve_rerank/README

examples/cross_encoder/applications/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
SentenceTransformers also supports to load Cross-Encoders for sentence pair scoring and sentence pair classification tasks.
33

44

5-
## Bi-Encoder vs. Cross-Encoder
5+
## Cross-Encoder vs. Bi-Encoder
66

77
First, it is important to understand the difference between Bi- and Cross-Encoder.
88

@@ -33,13 +33,13 @@ Using Cross-Encoders is quite easy:
3333
```python
3434
from sentence_transformers.cross_encoder import CrossEncoder
3535

36-
model = CrossEncoder("model_name_or_path")
36+
model = CrossEncoder("cross-encoder/ms-marco-MiniLM-L6-v2")
3737
scores = model.predict([["My first", "sentence pair"], ["Second text", "pair"]])
3838
```
3939

4040
You pass to `model.predict` a list of sentence **pairs**. Note, Cross-Encoder do not work on individual sentence, you have to pass sentence pairs.
4141

42-
As model name, you can pass any model or path that is compatible with Hugging Face [AutoModel](https://huggingface.co/transformers/model_doc/auto.html) class
42+
As model name, you can pass any model or path that is compatible with Hugging Face [AutoModel](https://huggingface.co/transformers/model_doc/auto.html) class.
4343

4444

4545
For a full example, to score a query with all possible sentences in a corpus see [cross-encoder_usage.py](cross-encoder_usage.py).

examples/cross_encoder/training/ms_marco/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ If you are interested in how to use these models, see [Application - Retrieve &
55

66
## Cross Encoder
77
```{eval-rst}
8-
A `Cross Encoder <../../applications/README.md>`_ accepts both a query and a possible relevant passage and returns a score denoting how relevant the passage is for the given query. Often times, a :class:`torch.nn.Sigmoid` is applied over the raw output prediction, casting it to a value between 0 and 1.
8+
A `Cross Encoder <../../applications/README.html>`_ accepts both a query and a possible relevant passage and returns a score denoting how relevant the passage is for the given query. Often times, a :class:`torch.nn.Sigmoid` is applied over the raw output prediction, casting it to a value between 0 and 1.
99
```
1010

1111
![CrossEncoder](https://raw.githubusercontent.com/UKPLab/sentence-transformers/master/docs/img/CrossEncoder.png)

0 commit comments

Comments
 (0)