(window.webpackJsonp=window.webpackJsonp||[]).push([[279],{1459:function(e,n){e.exports={attributes:{title:"Sentence Similarity",description:'When we have two TextFields in the datasets and potentially a LabelQuestion or RankingQuestion, we can define a TrainingTaskForSentenceSimilarity to use our ArgillaTrainer integration for fine-tuning with "sentence-transformers" to train a model for sentence similarity to optimize Retrieval Augmented Generation tasks (RAG) with better retrieval and reranking.',links:[{linkText:"Practical guide to Sentence Similarity",linkLink:"https://docs.argilla.io/en/latest/practical_guides/fine_tune.html#sentence-similarity"}]},body:'```python\nfrom argilla.feedback import ArgillaTrainer, FeedbackDataset, TrainingTask\n\ndataset = FeedbackDataset.from_argilla(\n    name="<my_dataset_name>",\n    workspace="<my_workspace_name>"\n)\ntask = TrainingTask.for_question_answering(\n    texts=[dataset.field_by_name("premise"), dataset.field_by_name("hypothesis")],\n    label=dataset.question_by_name("label")\n)\ntrainer = ArgillaTrainer(\n    dataset=dataset,\n    task=task,\n    framework="sentence-transformers",\n)\ntrainer.update_config()\ntrainer.train()\n```'}}}]);