Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Natural Language API's Content Category Overlap

Hello Cloud Forum

Let's say I have a daily news site covering 5 distinct news categories: Politics, Finance, Sports, Arts, Home improvements
When using the V1 model, the Natural Language API filters the categories returned by the classifyText method to include only the most relevant categories for a request. In some cases we found that not to be the case. Here is an example.

For example when a post was published under Home improvements news category and was about Paint Brush, the API returned
/Hobbies & Leisure/Crafts/Art & Craft Supplies,
which was a wrong category. It should have returned
/Home & Garden/Home Improvement/House Painting & Finishing.
Is there any way to instruct the API to use only
/Home & Garden/Home Improvement/House Painting & Finishing.
For analyzing posts or exclude
/Hobbies & Leisure/Crafts/Art & Craft Supplies,
From returning

2 REPLIES 2

Hello,

Thank you for contacting the Google Cloud Community.

I have gone through your reported issue, however it seems like this is an issue observed specifically at your end. It would need more specific debugging and analysis. To ensure a faster resolution and dedicated support for your issue, I kindly request you to file a support ticket by clicking here[1]. Our support team will prioritize your request and provide you with the assistance you need.

For individual support issues, it is best to utilize the support ticketing system. We appreciate your cooperation!

[1]: https://cloud.google.com/support/docs/manage-cases#creating_cases

Hi Jeerahalli

Thanks for your reply. here is another example. 

As listed below ,  the Natural Language API's Content Categories has 27 major categories (and 620 sub categories.). 

When I already know my text is generally about Sport, in order to narrow down text categorization and increase accuracy, I want to only use /Sports (from 27 major categories) to analyze my text ( not for example  /Arts & Entertainment). what's the way to accomplish this? 

 

Content Categories:

/Adult
/Arts & Entertainment
/Autos & Vehicles
/Beauty & Fitness
/Books & Literature
/Business & Industrial
/Computers & Electronics
/Finance
/Food & Drink
/Games
/Health
/Hobbies & Leisure
/Home & Garden
/Internet & Telecom
/Jobs & Education
/Law & Government
/News
/Online Communities
/People & Society
/Pets & Animals
/Real Estate
/Reference
/Science
/Sensitive Subjects
/Shopping
/Sports
/Travel

Top Labels in this Space
Top Solution Authors