If you are looking for a similarity checker to automatically compare two different texts, Twinword’s Text Similarity API can help. This API can score how closely two words, two sentences, or two paragraphs are semantically related to each other.
There is one more thing! One of great use case with Text Similarity API is a text classification. Text classification usually needs to build custom taxonomy. Since there is a difficulty in creating custom taxonomy, and takes time to update custom taxonomy, we advise alternative way to get text classification results using Text Similarity API.
How it Works?
The ‘value’ of Text Similarity API is not normalized similarity. You can rely on ‘similarity’ or ‘value’ at your convenience. The higher the score or value, the more semantically related those documents are.
Twinword Text Similarity API concerns related words that are based on the word associations database. For example, “mother loves son” and “Father loves daughter” overlaps just one word though, we can get higher score than 0.3 thanks to semantic understanding.
[Similarity: 0.59]
I love a dog
I dislike a dog
[Similarity: 0.95]
I hate a dog
I dislike a dog
If given documents have too much functional words and pronouns rather than content words, our Text Similarity API might fail to detect the similarity.
In other words, Twinword Text Similarity API provides semantic similarity only. Regarding syntactic similarity, lots of programing language provide it. For example, PHP Levenshtein function gives you syntactic score given two strings.
We do not recommend comparison between words since it’s very limited. The Text Similarity API is good at comparing sentence or paragraph to identify semantic relations.
What Will You Build?
Developers can use this technology in building many tools. Here is just a short list of some ideas.
- Document search engine to retrieve the most related documents.
- Software that sorts through a large repository of text and categorize them automatically. If you have example text for each category, when given new text, just use the API to see which category example it most closely relates to.
- Plagiarism checker to detect if two papers or essays are related and the same, even if they don’t use the same words.
If you can automatically know the distance and relationship between any two pieces of text, what will you build?
Text Classification Using Text Similarity API
One of great use case with Text Similarity API is a text classification. Text classification usually needs to build custom taxonomy. Since there is a difficulty in creating custom taxonomy, and takes time to update custom taxonomy, we advise alternative way to get text classification results using Text Similarity API.
It’s simple. Just try to use text similarity API to judge how the given text are close to the given category. Using this method, you can check custom taxonomy on your side instantly.
The below is an input to get classification results using Text Similarity API to check the given text belongs to ‘Bicycle Accessories’ or not.
Text1: cycling, outdoor recreation, sporting goods, riding, bicycle, gloves, helmets, knee pads, elbow pads
Text2: If you ride a scooter, one of the safest things you can do is to wear a helmet. There are many choices and styles, so you can easily find one to suit your needs.
Likewise, for ‘Food’ category, you can try the below (Text1 is your understanding about food category while Text2 is a target document for automatic text categorization):
Text1: food, milk, water, salt, smell, ingredient, taste, pizza, bread, chicken soup, apple, banana, berry
Text2: If you ride a scooter, one of the safest things you can do is to wear a helmet. There are many choices and styles, so you can easily find one to suit your needs.
Obviously, the first comparison would get higher score than the second one. As a result, the given document (Text2) will be classified as ‘Bicycle Accessories’ category.
Try The Document Similarity Checker Demo For Free
To try this API, head over to the Text Similarity API Demo Page.
You can also consume this API on RapidAPI Marketplace or directly with us via Amazon AWS Marketplace. Find more information on how to consume our API.