Today everyone is facing the challenge of finding work. And all feel excitement before the upcoming interview. Using voice assistant capabilities, we decided to create a skill which could interview applicants. We named it Personal Recruiter.
Personal Recruiter is a skill which can interview you on theoretical issues. The main aim of Alexa Recruiter, at this stage of development, is to prepare applicant to real interview and determine his level.
With further development, Personal Recruiter would be able to conduct full interviews which would facilitate hr’s work.
Skill available in the store: Recruiter
Preparation for the developmentIn the beginning, we decided to develop 2 categories related to interviews:
Front-end JavaScript and Node.js.
Category Front-end JavaScript contains questions about:
- HTML/CSS;
- algorithms;
- JavaScript;
- client JavaScript.
Category Node.js contains questions about:
- JavaScript;
- algorithms;
- database;
- Node.js.
At this moment Personal Recruiter can work with 3 types of questions, such as:
1) When answer only is “yes” or “no”
-In html5 need DTD?
-yes/no
2) When answer is usual, such as:
-Which attribute specifies a unique identifier for the html element?
-ID
3) When answer is a list of answers, such as:
-What kind of data storage do you know?
-local storage, cookies, session storage
The Voice User InterfaceThe voice user interface of Personal Recruiter is simple and easily understandable for users. We tried to make him more like real interview.
Note, however, that the actual voice responses vary somewhat from their representations above for brevity's sake.
Creating Alexa SkillCreating a model of interactionsThe Intent scheme looks like:
- Start is for choosing topic;
- AnswerQuestion is for answering question;
- AMAZON.RepeatIntent is for repetition of the question.
{
"intents": [
{
"intent": "Start",
"slots": [
{
"name": "Topic",
"type": "LIST_OF_LANGUAGES"
}
]
},
{
"intent": "AnswerQuestion",
"slots": [
{
"name": "Answer",
"type": "ANSWER"
}
]
},
{
"intent": "AMAZON.CancelIntent"
},
{
"intent": "AMAZON.RepeatIntent"
},
{
"intent": "AMAZON.StopIntent"
},
{
"intent": "AMAZON.HelpIntent"
}
]
}
Then on sample utterances, it looks like this.
Start choose {Topic}
Start select {Topic}
Start set {Topic}
Start start {Topic}
Start I select {Topic}
Start let's {Topic}
Start {Topic}
AnswerQuestion answer {Answer}
AnswerQuestion answer is {Answer}
AnswerQuestion my answer is {Answer}
AnswerQuestion i think {Answer}
AnswerQuestion the answer is {Answer}
AnswerQuestion {Answer} is my answer
AnswerQuestion {Answer}
AMAZON.RepeatIntent repeat please
AMAZON.RepeatIntent repeat the question
AMAZON.RepeatIntent repeat the question please
AMAZON.RepeatIntent please repeat the question
Also we had a trouble with 3rd type of questions (look at Preparation for the development). Users might not know all correct answers or say it in wrong order then answer wouldn’t be counted. The issues like this had been solved by AMAZON.LITERAL. But now this service is not supported:
To solve this problem, we made a python script which can mix list of answers to find all available answer options.
from itertools import chain, combinations, permutations
import json
from pprint import pprint
def all_combinations(ss):
return chain(*map(lambda x: combinations(ss, x), range(0, len(ss)+1)))
def all_permutations(arr):
result = []
for combination in all_combinations(arr):
combination_permutations = list(permutations(combination))
for permutation in combination_permutations:
result.append(" ".join(permutation))
return result
with open('question_list.json') as data_file:
data = json.load(data_file)
result = set()
for level in data:
for topic in level:
for question in level[topic]:
if 'type' in question and question['type'] == 1:
tmp = all_permutations(question['answer'])
result |= set(tmp)
else:
result |= set(question['answer'])
for el in result:
print(el)
Creating Lambda SkillNext we need to process this list of answers.
if (question.type === MULTIPLE_ANSWERS) {
userAnswer = userAnswer.split(" ");
let countOfCorrect = 0;
userAnswer.forEach((currentAnswer, index) => {
//some answer contain spaces, so after split it's 2 different elements in array.
//if two sequential elements or current element is in the list of answers, consider as the correct answer.
//for processing questions like "What kind of data storage do you know?" Where answers: [local storage, session storage, cookies]
//We consider that user answered correctly, if he specified more than half of answers in the list(e.g. local storage cookies)
if (answer.indexOf(currentAnswer) > -1) {
countOfCorrect++;
} else if (index + 1 < userAnswer.length &&
answer.indexOf(currentAnswer + " " + userAnswer[index + 1]) > -1) {
countOfCorrect++;
}
});
if (countOfCorrect > answer.length / 2) {
result = true;
}
} else {
result = answer.indexOf(userAnswer) > -1;
}
Alexa takes answers one by one word. But some answers consist of 2 or more words. So in this case Alexa would process answer as incorrect. To protect our program from this issue, we created a check function for answers with 2 or more words in it.
if (index + 1 < userAnswer.length &&
answer.indexOf(currentAnswer + " " + userAnswer[index + 1]) > -1) {
countOfCorrect++;
}
Check out “Code” section for more details about code.
Alexa cardsYou can check all statistic about passed interviews in your account on http://alexa.amazon.com/
Cards creation:
function buildCardText(detailedStatistic) {
let text = "Your detailed statistic: \n";
for (let key of Object.keys(detailedStatistic)) {
let value = detailedStatistic[key];
text += `You answered correctly ${value.correctCount} out of ${value.totalCount} in ${key} topic \n`;
}
return text;
}
ConclusionAs a result of work we have a useful Alexa skill. Using this skill you can prepare for an upcoming interview.
This skill could be extended.
Feel free to contact us or open issues on GitHub.
Comments