Tagging API
Tag any text with only few lines of code.
The Text Tagging API is a service that addresses a wide range of business-critical needs. Our most advanced AI-powered taggers give you the ability to assign relevant tags to all documents of your databases automatically. Tagging API quickly brings out new functionalities for any search engine, from predicting missing skills in resumes to delivering crucial insights on your data.
This article will look at how to interact with the endpoint 🧠 Tag a Text with a few queries sent through our public HrFlow.ai Postman collection. The final goal is to leverage the tags provided by our API to get better search results.
Prerequisites
API Endpoint
Get more information about the endpoint 🧠 Tag a Text.
Step 1: Configure your Postman Environment
Following the steps from the HrFlow.ai Postman publication will make you land on this page:
First, click on the "Environments" tab on the left side of your Postman window. Then, fill in the Empty - Environment template with the correct values. The compulsory variables for Tagging are:
x-api-key
: follow the steps from 🔑 API Authentication to retrieve itx-user-email
: follow the steps from 🔑 API Authentication to retrieve it
Finally, save the environment and ensure that you selected Empty - Environment as your current environment.
Step 2: Get your First Tagging Results
Now that the environment is selected, we can test our first request to Tag a Text. To do so, fill in your body parameters in a raw format:
- [MANDATORY]
text
: the text for which you want to assign some tags. - [MANDATORY]
algorithm_key
: the tagger's name can be one of the following
Algorithm Key | Tagging Set | Identifiers Set | Referential Size | Languages Supported | Use case |
---|---|---|---|---|---|
tagger-rome4-family | Grand domaines of job the French ROME 4.0 | ROME 4.0 Grand domaines codes | 14 | FR ,EN | customer without a clean taxonomy |
tagger-rome4-subfamily | Domaines of job the French ROME 4.0 | ROME 4.0 Domaines codes | 109 | FR ,EN | customer without a clean taxonomy |
tagger-rome4-category | Metiers of job the French ROME 4.0 | ROME 4.0 Metiers codes | 590 | FR ,EN | customer without a clean taxonomy |
tagger-rome4-jobtitle | Appellations of job the French ROME 4.0 | ROME 4.0 OGR codes | 6286 | FR ,EN | customer without a clean taxonomy |
tagger-rome-family | Grand domaines of job the French ROME | ROME Grand domaines codes | 14 | FR ,EN | customer without a clean taxonomy |
tagger-rome-subfamily | Domaines of job the French ROME | ROME Domaines codes | 109 | FR ,EN | customer without a clean taxonomy |
tagger-rome-category | Metiers of job the French ROME | ROME Metiers codes | 528 | FR ,EN | customer without a clean taxonomy |
tagger-rome-jobtitle | Appellations of job the French ROME | OGR codes | 8500 | FR ,EN | customer without a clean taxonomy |
tagger-hrflow-skills | Predicts missing hard skills and soft skills | Identifiers defined by HrFlow.ai | 5000 | FR ,EN | customer without a clean taxonomy |
tagger-hrflow-dynamic | Predict any output given a list of texts and labels | Identifiers defined by HrFlow.ai | N/A | 43 languages* | customer with a clean taxonomy and labels count < 32 |
- [OPTIONNAL]
top_n
: number of tags returned through the API. Defaults to1
. - [OPTIONNAL]
output_lang
: the returned tags will be either infr
(French) oren
(English). Defaults tofr
.
Current status on taggers development
We are currently working on several improvements:
- New Taggers: We are actively working on releasing more taggers to the public.
- Extended Language Support: Our taggers will support 43 languages, including: Afrikaans, Albanian, Arabic, Bengali, Bulgarian, Catalan, Chinese, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Latvian, Lithuanian, Macedonian, Nepali, Norwegian, Persian, Polish, Portuguese, Romanian, Russian, Slovak, Slovenian, Spanish, Swedish, Tagalog, Thai, Turkish, Ukrainian, Vietnamese.
So keep an eye on our blog (https://blog.hrflow.ai/) and our product notes (https://updates.hrflow.ai/) to stay in touch with our latest taggers.
Let's break down the Tagging request's response. The field data of the response object contains three lists with the same length:
predictions
: AI prediction scores sorted in descending ordertags
: tags associated with the prediction scores.ids
: unique identifiers associated to each tag
How to read the values in predictions ?
Both
predictions
,tags
andids
lists are synchronized. The n-th prediction is associated with the n-th tag.In our example above:
- Installation and maintenance scores at 0.53517
- Transport and logistics scores at 0.20379
- Industry scores at 0.08764
Advanced Topics
1. Try Tagging in your Favorite Programming Language
Once you have tried the request in Postman, you can directly convert it to work with your favorite programming language. Here is an example with Python and the module Requests.
import requests
url = "https://api.hrflow.ai/v1/text/tagging"
payload = {
"algorithm_key": "tagger-rome-family",
"text": "Our client, specialized in the sale and mechanics of heavy goods vehicles with a national network, is looking for heavy goods vehicle mechanics for its sites based in Arras, Lens and Douai.",
"texts": [],
"top_n": 3,
"output_lang": "en",
"labels":[]
}
headers = {
'X-USER-EMAIL': 'FILL THIS',
'X-API-KEY': 'FILL THIS',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)
2. Custom Tagging with Custom Labels and Taxonomis
In this example, we use the tagger-hrflow-dynamic
to assign user-defined labels to a set of texts. This is useful for categorizing texts based on custom criteria.
import requests
url = "https://api.hrflow.ai/v1/text/tagging"
payload = {
"algorithm_key": "tagger-hrflow-dynamics",
"texts": ["Data Insights Corp. is seeking a Senior Data Scientist for a contract-to-direct position. You will be responsible for designing and implementing advanced machine learning algorithms and playing a key role in shaping our data science initiatives. The CDI arrangement offers a pathway to a full-time role", "DataTech Solutions is hiring a Data Scientist for a fixed-term contract of 12 months. You will work on various data analysis and modeling projects and assisting in short-term projects; with the possibility of extension or permanent roles"],
"top_n": 1,
"dynamic_context": "The CDI is a Contrat à Durée Indeterminée - essentially an open-ended or permanent employment contract. The CDD is a Contrat à Durée Determinée - a fixed-term or temporary employment contract. These are the two most common types but by no means the only form of French employment contract. The contracts have to be drawn up by the employer, who must ensure that it's legally the correct type for the circumstances.",
"dynamic_labels": ["CDI", "CDD"]
}
headers = {
'X-USER-EMAIL': 'FILL THIS',
'X-API-KEY': 'FILL THIS',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.text)
Updated 3 months ago