SECRET OF CSS

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)
1*UEH0WRKeUwMFL7C1NioZ1w
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 ubiai.tools API options:
const apiRoot = 'https://api.ubiai.tools:8443/api_v1/annotate/';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;
1*0yEi1hoYtsNufvB6HJeTiA
API response (By author)
1*WG0MOJbdFh9d3H1t7S7Sew
Final code: API call (By author)
1*VFLDZ4tqTjIJL5bPyS6cYw
Results on google sheet (By author)



News Credit

%d bloggers like this: