Search…
Label
Label any type of text data.

Label text

Forefront Label is a multi-label classification API that can generalize to any labeling use case. See pricing
post
https://solutions.forefront.ai
/v1/organization/{TEAM_ID}/label
Label text

Example request

Python
Javascript
cURL
import requests
import json
headers = {
"Authorization": "Bearer {API_KEY}",
"Content-Type": "application/json"
}
body = {
"intructions": "Apply labels to the eCommerce product based on its title.",
"examples": [
{
"text": "<Example text to label>",
"labels": "<Relevant labels>"
},
{
"text": "<Example text to label>",
"labels": "<Relevant labels>"
}
],
"text": "<Enter text to label>",
}
res = requests.post(
"https://solutions.forefront.ai/v1/organization/{TEAM_ID}/label",
json=body,
headers=headers
)
data = res.json()
completion = data['result'][0]['completion']
const fetch = require('node-fetch');
const url = 'https://solutions.forefront.ai/v1/organization/{TEAM_ID}/label';
const headers = {
"Authorization": "Bearer {API_KEY}",
"Content-Type": "application/json"
};
const body = {
"intructions": "Apply labels to the eCommerce product based on its title.",
"examples": [
{
"text": "<Example text to label>",
"labels": "<Relevant labels>"
},
{
"text": "<Example text to label>",
"labels": "<Relevant labels>"
}
],
"text": "<Enter text to label>",
}
fetch(url, {
method: 'POST',
headers,
body: JSON.stringify(body)
}).then(async (res) => {
const data = await res.json()
console.log(data)
})
curl https://solutions.forefront.ai/v1/organization/{TEAM_ID}/label \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {API_KEY}' \
-d '{
"text": "<Enter text to label>",
"examples": [
{
"text": "<Example text to label>",
"labels": "<Relevant labels>"
},
{
"text": "<Example text to label>",
"labels": "<Relevant labels>"
}
],
"intructions": "Apply tags/labels to the eCommerce product based on its title"
}'

Example use cases

The Forefront Label API can be used to accurately label text based on your specific use case.

Label e-commerce product data

A common text labelling use case is to label product data by its relevant categories. To begin using the Label API for this use case, we will want to add some instructions and examples. This can look like the following:
{
"instructions": "Label the categories of the following product data.",
"examples": [
{
"text": "Product title: Philips Sonicare Protective Clean 6500 Rechargeable Electric Power Toothbrush with Charging Travel Case and Extra Brush Head, Deep Purple, HX6462/09\nProduct description: Gentle yet effective to whiten teeth in just 1 week vs. a manual toothbrush. Protect your teeth with a pressure sensor that gently pulses to alert you when you're brushing too hard. Always know when to replace your brush head for an effective clean with the brush head replacement reminder. 2 minute timer with QuadPacer helps ensure dental professional recommended brushing time and a consistent clean throughout your mouth. Includes: 1 handle, 1 charger, 2 DiamondClean brush heads, 1 charging travel case",
"labels": "Health & Household, Oral Care, Toothbrush & Accessories, Powered Toothbrushes, Philips"
},
{
"text": "Product title: TUO Paring Knife 3.5 inch Peeling Knife Professional Fruits Knife Vegetable Peeler Razor Sharp Small Kitchen Knife, Premium AUS-8 Steel with Pakkawood Handle, Ring Lite Series with Gift Box\nProduct description: Ring Lite paring knife will come in handy in many cases with its smaller length, no matter you need to deal with vegetables or fruits. It can paring, peeling, fluting mushrooms, creating decorative fruit or vegetable garnishes and for prepping small, spherical fruits and vegetables. Featured with tapered shape, each blade of Ring Lite knife has been mirror-polished, shining with mysterious and magnificent silver light. The brown-red coil that connects the blade to the handle adds a classic flavor, and the black rounded pakkawood handle showed the simple beauty of this knife. Your noble taste can be fully displayed when you use this knife. Adopting high-quality imported Japanese AUS-8 Steel, which enjoys a high reputation in the industry. Each blade is featured special-forged technology with a precise vacuum heat-treatment and nitrogen cryogenic tempering, it ensures you the superb hardness, flexibility, durability, as well as stunning cutting performance. Each of our knife provide an ergonomic handle, which is made of pakkawood, has wonderful capability on anti corrosion, wear-resisting, anti slip and so on. Its light weight will keep your hands from getting tired even after long hours of work, whether you have sweat or oil on your palms, you can use this handle comfortably. Tuo will continue to provide customers with the best service and zero risk shopping. You can receive your knife with a exquisite gift box as well as enjoy the lifetime warranty. If you've been struggling with what to give your family and friends, why not choose TUO Ring Lite series knife.",
"labels": "Home & Kitche, Kitchen & Dining, Kitchen Utensils, Kitchen Knives, Carving Knives"
}
],
"text": "<Example to label will go here>"
}
In general more examples will lead to better performance, but as you'll see, one or two examples can already give production-quality performance. We can now label any product data in the following request:
import requests
import json
headers = {
"Authorization": "Bearer {API_KEY}",
"Content-Type": "application/json"
}
body = {
"instructions": "Label the categories of the following product data.",
"examples": [
{
"text": "Product title: Philips Sonicare Protective Clean 6500 Rechargeable Electric Power Toothbrush with Charging Travel Case and Extra Brush Head, Deep Purple, HX6462/09\nProduct description: Gentle yet effective to whiten teeth in just 1 week vs. a manual toothbrush. Protect your teeth with a pressure sensor that gently pulses to alert you when you're brushing too hard. Always know when to replace your brush head for an effective clean with the brush head replacement reminder. 2 minute timer with QuadPacer helps ensure dental professional recommended brushing time and a consistent clean throughout your mouth. Includes: 1 handle, 1 charger, 2 DiamondClean brush heads, 1 charging travel case",
"labels": "Health & Household, Oral Care, Toothbrush & Accessories, Powered Toothbrushes, Philips"
},
{
"text": "Product title: TUO Paring Knife 3.5 inch Peeling Knife Professional Fruits Knife Vegetable Peeler Razor Sharp Small Kitchen Knife, Premium AUS-8 Steel with Pakkawood Handle, Ring Lite Series with Gift Box\nProduct description: Ring Lite paring knife will come in handy in many cases with its smaller length, no matter you need to deal with vegetables or fruits. It can paring, peeling, fluting mushrooms, creating decorative fruit or vegetable garnishes and for prepping small, spherical fruits and vegetables. Featured with tapered shape, each blade of Ring Lite knife has been mirror-polished, shining with mysterious and magnificent silver light. The brown-red coil that connects the blade to the handle adds a classic flavor, and the black rounded pakkawood handle showed the simple beauty of this knife. Your noble taste can be fully displayed when you use this knife. Adopting high-quality imported Japanese AUS-8 Steel, which enjoys a high reputation in the industry. Each blade is featured special-forged technology with a precise vacuum heat-treatment and nitrogen cryogenic tempering, it ensures you the superb hardness, flexibility, durability, as well as stunning cutting performance. Each of our knife provide an ergonomic handle, which is made of pakkawood, has wonderful capability on anti corrosion, wear-resisting, anti slip and so on. Its light weight will keep your hands from getting tired even after long hours of work, whether you have sweat or oil on your palms, you can use this handle comfortably. Tuo will continue to provide customers with the best service and zero risk shopping. You can receive your knife with a exquisite gift box as well as enjoy the lifetime warranty. If you've been struggling with what to give your family and friends, why not choose TUO Ring Lite series knife.",
"labels": "Home & Kitche, Kitchen & Dining, Kitchen Utensils, Kitchen Knives, Carving Knives"
}
],
"text": "Product title: Makita CX203SYB 18V LXT® Lithium-Ion Sub-Compact Brushless Cordless 2-Pc. Combo Kit (1.5Ah)\nProduct description: Driver-Drill weighs only 2.9 lbs. with battery for reduced operator fatigue. Compact and ergonomic design at only 5-7/8\" long. Mechanical variable 2-speed transmission (0-500 & 0-1,700 RPM) for a wide range of drilling and fastening applications. Makita-built Brushless Motor delivers 350 in.lbs. of Peak Torque. Engineered with a metal jampot design for increased durability"
}
res = requests.post(
"https://solutions.forefront.ai/v1/organization/{TEAM_ID}/label",
json=body,
headers=headers
)
data = res.json()
completion = data['result'][0]['completion']
Here's the product data we sent in the text parameter above:
Product title: Makita CX203SYB 18V LXT® Lithium-Ion Sub-Compact Brushless Cordless 2-Pc. Combo Kit (1.5Ah)
Product description: Driver-Drill weighs only 2.9 lbs. with battery for reduced operator fatigue. Compact and ergonomic design at only 5-7/8" long. Mechanical variable 2-speed transmission (0-500 & 0-1,700 RPM) for a wide range of drilling and fastening applications. Makita-built Brushless Motor delivers 350 in.lbs. of Peak Torque. Engineered with a metal jampot design for increased durability
And the following labels were returned:
Tools, Power Tools, Drill
Last modified 1mo ago
Copy link
On this page
Label text
post
Label text
Example request
Example use cases