Annotate Text From Google Sheet Using Google Apps Script and Machine Learning APIs | by Belhassen Essid | Sep, 2022

Let’s work smarter, not harder (By author)
Table of ContentsA Practical Use Case: HR Recruiting Process
How To Do This?
Let’s Do It!
Final Code, Results and Conclusion
1*E36FBPiNHjr9xd3 uqs3kw
Demo: The user enters a job description in a google sheet, then gets the skills, experience, and diploma from it using functions we will create (By the author)
  • UBIAI Auto-Labeling API: Provides the ability to train NLP models for auto-labeling and inference. The auto-labeling tool reduces the time and money it takes to label data and allows an automatic annotation of entities, such as time, place, date, product, person, etc., after downloading text from native files.
0*G6jIkMb 25O p0ed
Auto labeling tool to extract Skills, Diplomas, Experience, etc. (Source: UBIAI)

Google Apps Script

1* az62WhN8rYDEkyXymQyEQ
Google Sheets (By author)
Google Apps Script created from a Google sheet (By author)
  • The first thing to do in the script is to take the data from the user’s sheet. The user will call a function, passing the cell corresponding to the job description to it. So let’s add a parameter to our function, which corresponds to the user’s job description input, and then assign it to a variable that will be included in the body of the API call. Here’s the code:
1*iIDAHl wh T7Beb7vT2OJA
Get the data (By author)
  • Next, let’s set the appropriate API options:
const apiRoot = '';const apiToken = '*** Secret String :) ***';const options = {
'method': 'post',
'contentType': 'application/x-www-form-urlencoded',
'payload': data
const response = UrlFetchApp.fetch(apiRoot + apiToken, options);const entities = JSON.parse(response)[0].entities;
API response (By author)
Final code: API call (By author)
Results on google sheet (By author)

News Credit

%d bloggers like this: