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 Set
tagger-rome-familyGrand domaines of job the French ROMEROME Grand domaines codes
tagger-rome-subfamilyDomaines of job the French ROMEROME Domaines codes
tagger-rome-categoryMetiers of job the French ROMEROME Metiers codes
tagger-rome-jobtitleAppellations of job the French ROMEOGR codes
tagger-hrflow-skillsPredicts missing hard skills and soft skillsIdentifiers defined by HrFlow.ai
tagger-hrflow-labelsPredict any output given a list of texts and labelsIdentifiers defined by HrFlow.ai
  • [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 actively working on releasing more taggers to the public. 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. Tagging with User-Defined Labels

In this example, we use the tagger-hrflow-labels 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-labels",
    "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"],
    "labels": ["CDI", "CDD"],
    "top_n": 1,
    "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."
}
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)