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

Uncover the Emma Watson Foundation (A Simple Look at Her Goals and Impactful Charity Work).

So, someone asked me the other day, “Hey, what’s the story with the Emma Watson Foundation? What’s it...

So, what is 1 12, and how do you use it? Get a clear answer and learn it fast.

Alright, so someone hits me with “what is 1 12”. Just like that, no context, nothing. My first reaction?...

How to claim your Bleacher Report class action settlement money? Easy steps to get your payout fast!

So, I came across this thing, the Bleacher Report class action settlement, not too long ago. It wasn’t...

Where can I find official Tommy Cash tour merchandise? (Discover cool t-shirts and exclusive collectibles online)

Alright, so I finally got around to putting my thoughts down about that Tommy Cash tour. It’s been...