Member-only story

Getting started with Sentence Transformers in Poetry

Emad Dehnavi
3 min readMay 14, 2024

Sentence Transformers is a Python framework for state-of-the-art sentence, text and image embeddings. In this post we going to set our local machine up and ready to use Sentence transformers, using Poetry.

Sentence Transformers

Poetry is a tool for dependency management and packaging in Python. if you didn’t yet used it, give it a try, you will love it, specially if like you are coming from a NPM world! I wrote a post about how to install Poetry and if you don’t have it yet, please go ahead and install it and get back to continue our journey with Sentence Transformers.

1 — Create a new Poetry project

Let’s start with a new Poetry project, go ahead and run the following

poetry new try-sentence-transformers

This will create a Poetry project with the following structure

try-sentence-transformers
├── pyproject.toml
├── README.md
├── try_sentence_transformers
│ └── __init__.py
└── tests
└── __init__.py

Now, in try_sentence_transformers folder let’s create a new file and call it main.py . This going the be the main file where we will use to write python code later on.

2 — Install Sentence Transformers…

--

--

Emad Dehnavi
Emad Dehnavi

Written by Emad Dehnavi

With 8 years as a software engineer, I write about AI and technology in a simple way. My goal is to make these topics easy and interesting for everyone.

No responses yet