Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8033567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:44:25+00:00 2026-06-05T01:44:25+00:00

I’m working with an API that maps my GTIN/EAN queries to product data. Since

  • 0

I’m working with an API that maps my GTIN/EAN queries to product data.

Since the data returned originates from merchant product feeds, the following is almost universally the case:

  • Multiple results per GTIN
  • Products’ titles are pretty much unstructured
  • Products’ titles are “polluted” with
    • SEO-related stuff,
    • information about the quantity contained,
    • “buy two, get one free” offers,
    • etc.

I’m looking for a programmatic way to either

  • choose the “cleanest”/most canonical version available
  • or generate a new one that represents the “lowest common denominator”.

Consider the following example results for a single EAN query:

  • Nivea Deo Roll-On Dry Impact for Men
  • NIVEA DEO Roll on Dry/blau
  • Nivea Deo Roll-On Dry Impact for Men, 50 ml, 3er Pack (3 x 50 ml)
  • Nivea Deo Roll on Dry/blau 50 ml
  • Nivea Deoroller 50ml dry for Men blau Mindestabnahme: 6 Stück (1 VE)
  • NIVEA Deoroller, Dry Impact for Men
  • NIVEA DEO Roll on Dry/blau_50 ml

My homebrew approach looks like this:

  • Basic cleanup:
    • Lowercase the titles,
    • strip excessive whitespace,
    • throw out apparent stopwords such as “buy” and “click”
  • Build an array for word => global occurence
    • "Nivea" => 7
    • "Deo" => 5
    • "Deoroller" => 2
    • …
    • "VE" => 1
  • Calculate the “cumulative word value” for each of the titles
    • "Nivea Deo" => 12
    • "Nivea Deoroller VE" => 10
  • Divide the cumulative value by the length of the title, resulting in a score
    • "Nivea Deo" => 6
    • "Nivea Deoroller VE" => 3.34

Obviously, my approach is pretty basic, error-prone and biased towards short sentences with frequently used words – yielding more or less satisfactory results.

  • Would you choose a different approach?
  • Is there some NLP magic way to take care of the problem that I don’t know of?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:44:26+00:00Added an answer on June 5, 2026 at 1:44 am

    Since your existing metric seems to bias towards shorter phrases, you should consider factoring in bigrams into the mix. So instead of considering scores for just individual words, additionally consider the score for consecutive pairs of words as well (e.g. ‘nivea deo’, deo roll-on’, ‘roll-on dry’, etc). When computing the score for each title, factor in the scores for every unigram and bigram you can generate out of the title together, but maybe give the bigrams more weight, and this should encourage your algorithm to prefer longer phrases.

    If you have large existing corpus of lots of names like these at your disposal, consider using something like TF-IDF
    What you are doing right can be likened to just using TF. Using your global corpus, you can compute the idf of each unigram and bigram, which is basically a measure of unique or rare a word or phrase is across the entire corpus.
    tf = the number of times you have seen an ngram within these results
    idf = a global measure of how unique an ngram might be across all results (or atleast a very large number of them)
    So when computing the score for a title, instead of simply adding up the tf’s of each ngram in it, you add up the tf*idf of each ngram instead. Rarer ngrams (which possibly do a better job at distinguishing this item from all other items) have a higher idf, so your algorithm should give higher weight to them. A lot of junk terms (like Mindestabnahme) would have really high idf, but they would have a really small tf, so they might not make a big difference. Alternatively prune off tokens you see fewer than k times, to get rid of noise.

    Another NLP trick to know about is Levenshtein distance .. which is a way to quantify how similar two strings are. You can compute the levenshtein distance between every pair of strings within your results, and then try preferring the result which has the lowest average distance from all the other strings. This might not work well by itself… but factoring this score in with your existing approach might help you navigate some tricky cases.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.