Resume OCR Node.js

The Node.js OCR SDK supports the Resume API.

Using the sample below, we are going to illustrate how to extract the data that we want using the OCR SDK.
Resume sample

Quick-Start

const mindee = require("mindee");
// for TS or modules:
// import * as mindee from "mindee";

// Init a new client
const mindeeClient = new mindee.Client({ apiKey: "my-api-key" });

// Load a file from disk
const inputSource = mindeeClient.docFromPath("/path/to/the/file.ext");

// Parse the file
const apiResponse = mindeeClient.enqueueAndParse(
  mindee.product.ResumeV1,
  inputSource
);

// Handle the response Promise
apiResponse.then((resp) => {
  // print a string summary
  console.log(resp.document.toString());
});

Output (RST):

########
Document
########
:Mindee ID: bc80bae0-af75-4464-95a9-2419403c75bf
:Filename: default_sample.jpg

Inference
#########
:Product: mindee/resume v1.0
:Rotation applied: No

Prediction
==========
:Document Language: ENG
:Document Type: RESUME
:Given Names: Christopher
:Surnames: Morgan
:Nationality:
:Email Address: [email protected]
:Phone Number: +44 (0) 20 7666 8555
:Address: 177 Great Portland Street, London W5W 6PQ
:Social Networks:
  +----------------------+----------------------------------------------------+
  | Name                 | URL                                                |
  +======================+====================================================+
  | LinkedIn             | linkedin.com/christopher.morgan                    |
  +----------------------+----------------------------------------------------+
:Profession: Senior Web Developer
:Job Applied:
:Languages:
  +----------+----------------------+
  | Language | Level                |
  +==========+======================+
  | SPA      | Fluent               |
  +----------+----------------------+
  | ZHO      | Beginner             |
  +----------+----------------------+
  | DEU      | Intermediate         |
  +----------+----------------------+
:Hard Skills: HTML5
              PHP OOP
              JavaScript
              CSS
              MySQL
:Soft Skills: Project management
              Strong decision maker
              Innovative
              Complex problem solver
              Creative design
              Service-focused
:Education:
  +-----------------+---------------------------+-----------+----------+---------------------------+-------------+------------+
  | Domain          | Degree                    | End Month | End Year | School                    | Start Month | Start Year |
  +=================+===========================+===========+==========+===========================+=============+============+
  | Computer Inf... | Bachelor                  |           |          | Columbia University, NY   |             | 2014       |
  +-----------------+---------------------------+-----------+----------+---------------------------+-------------+------------+
:Professional Experiences:
  +-----------------+------------+---------------------------+-----------+----------+----------------------+-------------+------------+
  | Contract Type   | Department | Employer                  | End Month | End Year | Role                 | Start Month | Start Year |
  +=================+============+===========================+===========+==========+======================+=============+============+
  | Full-Time       |            | Luna Web Design, New York | 05        | 2019     | Web Developer        | 09          | 2015       |
  +-----------------+------------+---------------------------+-----------+----------+----------------------+-------------+------------+
:Certificates:
  +------------+--------------------------------+---------------------------+------+
  | Grade      | Name                           | Provider                  | Year |
  +============+================================+===========================+======+
  |            | PHP Framework (certificate)... |                           | 2014 |
  +------------+--------------------------------+---------------------------+------+
  |            | Programming Languages: Java... |                           |      |
  +------------+--------------------------------+---------------------------+------+

Field Types

Standard Fields

These fields are generic and used in several products.

Basic Field

Each prediction object contains a set of fields that inherit from the generic Field class.
A typical Field object will have the following attributes:

  • value (number | string): corresponds to the field value. Can be undefined if no value was extracted.
  • confidence (number): the confidence score of the field prediction.
  • boundingBox ([Point, Point, Point, Point]): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
  • polygon (Point[]): contains the relative vertices coordinates (Point) of a polygon containing the field in the image.
  • pageId (number): the ID of the page, always undefined when at document-level.
  • reconstructed (boolean): indicates whether an object was reconstructed (not extracted as the API gave it).

Note: A Point simply refers to an array of two numbers ([number, number]).

Aside from the previous attributes, all basic fields have access to a toString() method that can be used to print their value as a string.

Classification Field

The classification field ClassificationField does not implement all the basic Field attributes. It only implements value, confidence and pageId.

Note: a classification field's value is always a string`.

String Field

The text field StringField only has one constraint: its value is a string (or undefined).

Specific Fields

Fields which are specific to this product; they are not used in any other product.

Certificates Field

The list of certificates obtained by the candidate.

A ResumeV1Certificate implements the following attributes:

  • grade (string): The grade obtained for the certificate.
  • name (string): The name of certification.
  • provider (string): The organization or institution that issued the certificate.
  • year (string): The year when a certificate was issued or received.
    Fields which are specific to this product; they are not used in any other product.

Education Field

The list of the candidate's educational background.

A ResumeV1Education implements the following attributes:

  • degreeDomain (string): The area of study or specialization.
  • degreeType (string): The type of degree obtained, such as Bachelor's, Master's, or Doctorate.
  • endMonth (string): The month when the education program or course was completed.
  • endYear (string): The year when the education program or course was completed.
  • school (string): The name of the school.
  • startMonth (string): The month when the education program or course began.
  • startYear (string): The year when the education program or course began.
    Fields which are specific to this product; they are not used in any other product.

Languages Field

The list of languages that the candidate is proficient in.

A ResumeV1Language implements the following attributes:

  • language (string): The language's ISO 639 code.
  • level (string): The candidate's level for the language.

Possible values include:

  • Fluent
  • Proficient
  • Intermediate
  • Beginner

Fields which are specific to this product; they are not used in any other product.

Professional Experiences Field

The list of the candidate's professional experiences.

A ResumeV1ProfessionalExperience implements the following attributes:

  • contractType (string): The type of contract for the professional experience.

Possible values include:

  • Full-Time
  • Part-Time
  • Internship
  • Freelance
  • department (string): The specific department or division within the company.
  • employer (string): The name of the company or organization.
  • endMonth (string): The month when the professional experience ended.
  • endYear (string): The year when the professional experience ended.
  • role (string): The position or job title held by the candidate.
  • startMonth (string): The month when the professional experience began.
  • startYear (string): The year when the professional experience began.
    Fields which are specific to this product; they are not used in any other product.

Social Networks Field

The list of social network profiles of the candidate.

A ResumeV1SocialNetworksUrl implements the following attributes:

  • name (string): The name of the social network.
  • url (string): The URL of the social network.

Attributes

The following fields are extracted for Resume V1:

Address

address (StringField): The location information of the candidate, including city, state, and country.

console.log(result.document.inference.prediction.address.value);

Certificates

certificates (ResumeV1Certificate[]): The list of certificates obtained by the candidate.

for (const certificatesElem of result.document.inference.prediction.certificates) {
  console.log(certificatesElem.value);
}

Document Language

documentLanguage (StringField): The ISO 639 code of the language in which the document is written.

console.log(result.document.inference.prediction.documentLanguage.value);

Document Type

documentType (ClassificationField): The type of the document sent.

Possible values include:

  • RESUME
  • MOTIVATION_LETTER
  • RECOMMENDATION_LETTER
console.log(result.document.inference.prediction.documentType.value);

Education

education (ResumeV1Education[]): The list of the candidate's educational background.

for (const educationElem of result.document.inference.prediction.education) {
  console.log(educationElem.value);
}

Email Address

emailAddress (StringField): The email address of the candidate.

console.log(result.document.inference.prediction.emailAddress.value);

Given Names

givenNames (StringField[]): The candidate's first or given names.

for (const givenNamesElem of result.document.inference.prediction.givenNames) {
  console.log(givenNamesElem.value);
}

Hard Skills

hardSkills (StringField[]): The list of the candidate's technical abilities and knowledge.

for (const hardSkillsElem of result.document.inference.prediction.hardSkills) {
  console.log(hardSkillsElem.value);
}

Job Applied

jobApplied (StringField): The position that the candidate is applying for.

console.log(result.document.inference.prediction.jobApplied.value);

Languages

languages (ResumeV1Language[]): The list of languages that the candidate is proficient in.

for (const languagesElem of result.document.inference.prediction.languages) {
  console.log(languagesElem.value);
}

Nationality

nationality (StringField): The ISO 3166 code for the country of citizenship of the candidate.

console.log(result.document.inference.prediction.nationality.value);

Phone Number

phoneNumber (StringField): The phone number of the candidate.

console.log(result.document.inference.prediction.phoneNumber.value);

Profession

profession (StringField): The candidate's current profession.

console.log(result.document.inference.prediction.profession.value);

Professional Experiences

professionalExperiences (ResumeV1ProfessionalExperience[]): The list of the candidate's professional experiences.

for (const professionalExperiencesElem of result.document.inference.prediction.professionalExperiences) {
  console.log(professionalExperiencesElem.value);
}

Social Networks

socialNetworksUrls (ResumeV1SocialNetworksUrl[]): The list of social network profiles of the candidate.

for (const socialNetworksUrlsElem of result.document.inference.prediction.socialNetworksUrls) {
  console.log(socialNetworksUrlsElem.value);
}

Soft Skills

softSkills (StringField[]): The list of the candidate's interpersonal and communication abilities.

for (const softSkillsElem of result.document.inference.prediction.softSkills) {
  console.log(softSkillsElem.value);
}

Surnames

surnames (StringField[]): The candidate's last names.

for (const surnamesElem of result.document.inference.prediction.surnames) {
  console.log(surnamesElem.value);
}

Questions?

Join our Slack