rjnClarke/intfloat-multilingual-e5-small-fine-tuned
rjnClarke
Similitud de oraciones
Un modelo Sentence Transformer afinado a partir de intfloat/multilingual-e5-small. Este modelo convierte oraciones y párrafos en un espacio vectorial denso de 384 dimensiones y se puede usar para similitud semántica textual, búsqueda semántica, minería de parafrases, clasificación de texto, agrupamiento y más.
Como usar
Primero, instala la librería Sentence Transformers:
pip install -U sentence-transformers
Luego puedes cargar este modelo y ejecutar inferencias.
from sentence_transformers import SentenceTransformer
# Descargar desde el Hub de 🤗
model = SentenceTransformer("rjnClarke/intfloat-multilingual-e5-small-fine-tuned")
# Ejecutar inferencias
sentences = [
'What is the significance of the tennis balls in the excerpt from the play?',
"Says that you savour too much of your youth,\n And bids you be advis'd there's nought in France That can be with a nimble galliard won; You cannot revel into dukedoms there. He therefore sends you, meeter for your spirit, This tun of treasure; and, in lieu of this, Desires you let the dukedoms that you claim Hear no more of you. This the Dauphin speaks. KING HENRY. What treasure, uncle? EXETER. Tennis-balls, my liege. KING HENRY. We are glad the Dauphin is so pleasant with us; His present and your pains we thank you for. When we have match'd our rackets to these balls, We will in France, by God's grace, play a set Shall strike his father's crown into the hazard. Tell him he hath made a match with such a wrangler That all the courts of France will be disturb'd With chaces. And we understand him well, How he comes o'er us with our wilder days, Not measuring what use we made of them. We never valu'd this poor seat of England; And therefore, living hence, did give ourself To barbarous licence; as 'tis ever common That men are merriest when they are from home. But tell the Dauphin I will keep my state, Be like a king, and show my sail of greatness, When I do rouse me in my throne of France; For that I have laid by my majesty And plodded like a man for working-days; But I will rise there with so full a glory That I will dazzle all the eyes of France, Yea, strike the Dauphin blind to look on us. And tell the pleasant Prince this mock of his Hath turn'd his balls to gun-stones, and his soul Shall stand sore charged for the wasteful vengeance\n That shall fly with them; for many a thousand widows\n",
"YORK. From Ireland thus comes York to claim his right\n And pluck the crown from feeble Henry's head: Ring bells aloud, burn bonfires clear and bright, To entertain great England's lawful king. Ah, sancta majestas! who would not buy thee dear? Let them obey that knows not how to rule; This hand was made to handle nought but gold. I cannot give due action to my words Except a sword or sceptre balance it.\n A sceptre shall it have, have I a soul\n On which I'll toss the flower-de-luce of France.\n Enter BUCKINGHAM [Aside] Whom have we here? Buckingham, to disturb me?\n The King hath sent him, sure: I must dissemble. BUCKINGHAM. York, if thou meanest well I greet thee well. YORK. Humphrey of Buckingham, I accept thy greeting. Art thou a messenger, or come of pleasure? BUCKINGHAM. A messenger from Henry, our dread liege, To know the reason of these arms in peace; Or why thou, being a subject as I am, Against thy oath and true allegiance sworn, Should raise so great a power without his leave, Or dare to bring thy force so near the court. YORK. [Aside] Scarce can I speak, my choler is so great. O, I could hew up rocks and fight with flint, I am so angry at these abject terms; And now, like Ajax Telamonius, On sheep or oxen could I spend my fury. I am far better born than is the King, More like a king, more kingly in my thoughts; But I must make fair weather yet awhile, Till Henry be more weak and I more strong.- Buckingham, I prithee, pardon me That I have given no answer all this while; My mind was troubled with deep melancholy. The cause why I have brought this army hither Is to remove proud Somerset from the King, Seditious to his Grace and to the state. BUCKINGHAM. That is too much presumption on thy part; But if thy arms be to no other end, The King hath yielded unto thy demand:\n The Duke of Somerset is in the Tower.\n",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Obtén las puntuaciones de similitud para las incrustaciones
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Logs de Entrenamiento
Epoch
Step
Training Loss
loss
multi-dev_cosine_map@100
1.0
162
-
1.7998
0.4106
2.0
324
-
1.6831
0.4286
3.0
486
-
1.6670
0.4343
3.0864
500
1.7796
-
-
4.0
648
-
1.6174
0.4501
5.0
810
-
1.5971
0.4559
6.0
972
-
1.5842
0.4620
6.1728
1000
1.0289
-
-
7.0
1134
-
1.5726
0.4651
Cita BibTeX
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
Funcionalidades
- Modelo de Transformador de Oraciones
- Modelo base: intfloat/multilingual-e5-small
- Longitud máxima de secuencia: 512 tokens
- Dimensionalidad de salida: 384 tokens
- Función de similitud: Similitud Coseno
- Idioma: en
- Licencia: apache-2.0
Casos de uso
- Similitud semántica
- Búsqueda semántica
- Minería de parafrases
- Clasificación de texto
- Agrupamiento