Integrating ChatGPT in HRIS (Human Resources Information System) Document Feature

Introduction

Background

In HRIS, we currently offer a feature called Document Creation, which allows users to generate documents based on user-defined templates and their employee information.

To improve the effectiveness of this feature and better support our customers in their roles as labor managers, we have introduced automated template generation powered by a Large Language Model (LLM). This integration enables customers to quickly create templates tailored to their needs, reducing the redundancy of manually generating commonly used documents like employment contracts and minimizing inconsistencies across documents.

Document Template Generation

Before Integrating AI

Our document creation feature enables users to generate documents based on templates. To incorporate employee information into the document, users need to insert a set of pre-defined placeholders in these templates for details like names, addresses, positions, and departments. When the document is generated, these placeholders are automatically replaced with the corresponding employee information from our backend.

After Integrating AI

With the AI generation feature, users can now effortlessly input the document template name and provide additional details, such as format or specific content requirements. Upon clicking the generate button, a draft template adjusted to the user’s specifications is created and displayed in the text editor area.

This feature leverages Azure OpenAI GPT-3 Turbo to generate the template based on the user’s inputs, which will be further explained in a later section. However, due to certain limitations, users are advised to review the draft and add any necessary information that may not be fully covered in the generated result.

Integrating Azure OpenAI and ChatGPT

Our feature combines Azure AI Search and OpenAI Chat capabilities. We leverage Azure AI Search to generate documents from pre-trained models, which serve as references for user inquiries.

Initially, we create embeddings using Azure AI Search, which captures a dense representation of a text’s semantic meaning. Each embedding is a vector of floating-point numbers closely aligned with the text’s content. In the next phase, these embeddings are employed to retrieve reference documents through Azure AI’s Vector Search, applying a minimum threshold score to filter out irrelevant documents from being used as references.

In the final step, we provide the reference documents to the OpenAI Chat feature to generate the final document in HTML, which serves as a template for users. The data sent to OpenAI includes messages assigned to three specific roles:

  • System: Sets the context and guidelines for the assistant, defining how it should behave and what it should focus on when generating the document.
  • User: Contains the user’s input or requests that initiate the document creation process.
  • Assistant: Guides the structure of the generated document according to specified rules (e.g., HTML format, employee information placeholders’ format), based on the system’s instructions and user input.

We also manage situations where users’ input includes inappropriate content, such as violent or harmful language.

The overall flow diagram is illustrated below: 

Using the Feature

The following section provides examples of generated templates from the feature, along with the error messages triggered when inappropriate language is detected in user input.

InputOutput
imageimage
imageimage
Malicious Inputimage (5)

Conclusion

Integrating ChatGPT into our HRIS document feature has really streamlined how labor managers create documents. By using Azure AI Search and OpenAI GPT-3 Turbo, we’ve made it easier and faster for users to generate personalized templates, cutting down on repetitive tasks and ensuring consistency across documents. While the AI does most of the heavy lifting, users still have the flexibility to tweak the results to fit their exact needs. Overall, this upgrade is expected to increase user productivity while keeping the document creation process in line with the organizational standards.

Published-date