Member-only story

Use Azure OpenAI and LangChain to categorize a document by combining input document with provided template documents

Ferry Djaja
6 min readSep 17, 2023

--

In this tutorial, we will learn how to categorize the documents using Azure OpenAI and LangChain.

As part of my daily responsibilities, I am tasked with reviewing change request (CR) documents submitted by my team. These CR documents come in two types: Normal and Standard. The primary distinction between these two types is that the Standard version is a simplified variant of the normal CR document. I have also made templates available for both document types to assist my team in adhering to a standardized format when submitting CRs. However, there are instances when the templates are not followed, leading to the need for request rejection. To facilitate both my team’s and I reviewing the CR document, I have developed an application for document review and categorization.

CR Templates

I have created CR template documents for both the standard and normal CR, which I will input into LangChain.

Standard CR (CR_Template_Standard.txt)

THIS IS STANDARD CR TEMPLATE DOCUMENT — START

Change Description
==================

Description:
<<jira id>>
Man hours Saved annually: <<man hours annually>>

Business Background :
<<description>>

Justification
=============
Business Justification:
<<business justification>>

Implementation Plan
===================
Deployment of this CR will be done on <<deployment date>>
E.g. Tuesday 05-Sep-2023
Deployment estimate timing: <<date with time in SGT >> e.g.10:30 AM SGT — 11:00 AM SGT
Validation/Sanity: <<date with time in SGT from and to >> e.g. 05-Sep-2023 11:01 AM SGT — 07-Sep-2023 07:00 PM SGT
New / Updated Recipe to be deployed to production:
New / Updated Recipes:
<<list of new/updated recipes>>

Lookup Table:
<<Lookup table name>>

Message Template:
<<message template name>>
Please mention other attributes if they are applicable
Who will perform the activities?
Deployment: <<name>>
Developer : <<name>>
List of applications impacted:
<<applications>>

Backout Plan…

--

--

No responses yet

Write a response