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

  1. ✨ Create a Workspace
  2. πŸ”‘ Get your API Key
  3. 🧠 Activate Text Tagging API
  4. Download HrFlow.ai's Postman

πŸ“˜

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:

Finally, save the environment and ensure that you selected Empty - Environment as your current environment.

2880

Postman Environment Configuration

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 KeyTagging SetIdentifiers SetReferential SizeLanguages SupportedUse case
tagger-rome4-familyGrand domaines of job the French ROME 4.0ROME 4.0 Grand domaines codes14FR,ENcustomer without a clean taxonomy
tagger-rome4-subfamilyDomaines of job the French ROME 4.0ROME 4.0 Domaines codes109FR,ENcustomer without a clean taxonomy
tagger-rome4-categoryMetiers of job the French ROME 4.0ROME 4.0 Metiers codes590FR,ENcustomer without a clean taxonomy
tagger-rome4-jobtitleAppellations of job the French ROME 4.0ROME 4.0 OGR codes6286FR,ENcustomer without a clean taxonomy
tagger-rome-familyGrand domaines of job the French ROMEROME Grand domaines codes14FR,ENcustomer without a clean taxonomy
tagger-rome-subfamilyDomaines of job the French ROMEROME Domaines codes109FR,ENcustomer without a clean taxonomy
tagger-rome-categoryMetiers of job the French ROMEROME Metiers codes528FR,ENcustomer without a clean taxonomy
tagger-rome-jobtitleAppellations of job the French ROMEOGR codes8500FR,ENcustomer without a clean taxonomy
tagger-hrflow-skillsPredicts missing hard skills and soft skillsIdentifiers defined by HrFlow.ai5000FR,ENcustomer without a clean taxonomy
tagger-hrflow-dynamicPredict any output given a list of texts and labelsIdentifiers defined by HrFlow.aiN/A43 languages*customer with a clean taxonomy and labels count < 32
  • [OPTIONNAL] top_n: number of tags returned through the API. Defaults to 1.
  • [OPTIONNAL] output_lang: the returned tags will be either in fr (French) or en (English). Defaults to fr.

πŸ“˜

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 order
  • tags: tags associated with the prediction scores.
  • ids: unique identifiers associated to each tag

πŸ“˜

How to read the values in predictions ?

Both predictions, tags and ids 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)