te ranking Explained: Get Higher Search Results Quickly.

Date:

Share post:

Today, I was messing around with text embeddings and stumbled upon this thing called “te-ranking”. I’d heard about it before, but never really dug in. So, I thought, why not give it a shot and see what all the fuss is about?

te ranking Explained: Get Higher Search Results Quickly.

First things first, I needed to get my hands on it. I found it on the internet, and it suggested to try it with “BAAI/bge-large-en-v1.5”, So I went with that one. Good old pip install got that sorted out pretty quick.

Getting Started

Once I had the library installed, I needed some data to play with. I grabbed a few sentences – nothing fancy, just some random stuff I found online. I wanted to see how it would rank these sentences based on a query.

Here’s the stuff I threw at it:

  • “The quick brown fox jumps over the lazy dog.”
  • “The weather is nice today.”
  • “I need to go grocery shopping.”
  • “Dogs are better than cats.”
  • “This is an example sentence.”

My query was simple: “What animals are mentioned?”

Putting It to the Test

I followed the basic example, creating a list of documents and my super simple query. Then I did model initialized with those files above, It felt like I was about to witness some magic.

te ranking Explained: Get Higher Search Results Quickly.

I typed some code to encode my query and documents into vector,then use a function to calculate the score between query and documents.

The Results

Boom! The model spit out a ranked list. It looked something like this:

  • score:0.67, text: “The quick brown fox jumps over the lazy dog.”
  • score:0.45, text:”Dogs are better than cats.”
  • score:0.12, text: “This is an example sentence.”
  • score:0.08, text:”I need to go grocery shopping.”
  • score:0.07, text:”The weather is nice today.”

It actually worked! “The quick brown fox…” sentence was at the top, followed by “Dogs are better than cats.”. The others, which weren’t really relevant, were way down the list. I gotta say, I was pretty impressed.

Overall, my little experiment with te-ranking was a success. It’s a simple way to get started with ranking text based on relevance, and it seems to work pretty well, even with my basic example. I can see how this could be useful for things like search engines or recommendation systems. Maybe I’ll explore it more in the future!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Related articles

Find out who won Daytona Rolex 24 and watch the race highlights here.

Man, let me tell you this Sunday morning was pure chaos. Woke up feeling like I got hit...

Top Royal Rags Costumes for Pets Find Your Favorite Style

Alright folks, today’s adventure was all about these fancy royal pet costumes I saw plastered everywhere online. Looked...

Planning An Event At O2 Dublin Capacity Size Rules You Need

Alright folks, let me walk you through my nightmare trying to figure out the crowd rules for an...

What is citi field interactive seating? (Learn how it enhances your game day fun!)

So yesterday I saw my buddy Mike ranting online about how he paid big bucks for Mets tickets...