NLP Engine Service
Overview
In the existing version of the chatbot, for the PGR complaint creation feature, the user has to select the city from a drop-down menu by visiting the mSeva website. This significantly reduces user convenience as the user is required to constantly switch pages. To overcome the above inconvenience, the nlp-engine service is used. The service has an algorithm that uses fuzzy matching and pattern recognition to recognise the city provided by the user as input. Based on the user input, the cities having the highest match ratio with the input are being returned as the output list. A list comprising all the city names in English, Punjabi and Hindi was used as a reference tool for this service.
Pre-requisites
Before you proceed with the documentation, make sure the following pre-requisites are met -
Python.
egov-mdms service is running and all the data related to the service are added to the MDMS repository.
egov-running service is running.
Key Functionalities
Provides city fuzzy search feature which returns the list of cities having the highest match ratio with the input.
City fuzzy search can support input data in English, Hindi and Punjabi language.
Provides locality fuzzy search feature which returns the list of localities having the highest match ratio with the input.
Environment Variables | Description |
---|---|
| Contains the module name of mdms required for nlp-engine. |
| Contains the file name of mdms master file which contains the city names in various locale. |
| Contains the file name of mdms master file which contains the tenantid of the cities present in |
| Contains the state level tenantid |
Interaction Diagram
Deployment Details
Add mdms configs required for nlp-engine service (mdms folder) and restart mdms service.
Deploy the latest version of nlp-engine service.
Whitelist the city and locality fuzzy search APIs.
Integration
Integration Scope
The nlp-engine service is used to locate user city and locality by using fuzzy string matching and pattern recognition.
Integration Benefits
Currently integrated into the chatbots for locating user city and locality for complaint creation use case.
This feature functionality can be extended for the other entities and can be used for a fuzzy search of those different entities.
Steps to Integration
To integrate, the host of nlp-engine service module should be overwritten in the helm chart.
/nlp-engine/fuzzy/city
should be added as the fuzzy search endpoint for a city search./nlp-engine/fuzzy/locality
should be added as the fuzzy search endpoint for locality search.
Reference Docs
Doc Links
Description | Link |
---|---|
NLP Chatbot |
API List
Description | Link |
---|---|
/nlp-engine/fuzzy/city | |
/nlp-engine/fuzzy/locality |
(Note: All the APIs are in the same postman collection therefore the same link is added in each row)
Last updated