NLP Engine Service

Overview

In the existing version of chatbot, for PGR complaint creation feature the user has to select his/her city form 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, nlp-engine service is use. The service has an algorithm which 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 in 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

MDMS_MODULE_NAME

Contains the module name of mdms required for nlp-engine.

CITY_MASTER

Contains the file name of mdms master file which contains the city names in various locale.

CITY_LOCALE_MASTER

Contains the file name of mdms master file which contains the tenantid of the cities present in CityNames.json mdms file

STATE_LEVEL_TENANTID

Contains the state level tenantid

 

Interaction Diagram

Deployment Details

  1. Add mdms configs required for nlp-engine service (mdms folder) and restart mdms service.

  2. Deploy the latest version of nlp-engine service.

  3. Whitelist the city and locality fuzzy search API’s.

Integration

Integration Scope

The nlp-engine service is used to locate the user city and locality by using fuzzy string matching and pattern recognition.

Integration Benefits

  • Currently integrated in 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 use for fuzzy search of those different entities.

Steps to Integration

  1. To integrate, host of nlp-engine service module should be overwritten in helm chart.

  2. /nlp-engine/fuzzy/city should be added as the fuzzy search endpoint for city search.

  3. /nlp-engine/fuzzy/locality should be added as the fuzzy search endpoint for locality search.

Reference Docs

Doc Links

Title 

Link

NLP Chatbot

https://docs.google.com/document/d/1Z3IgyjlZzAchlMPfURmUrgVfcSqU316R_0Z6KNrRbLo/edit?usp=sharing

API List

(Note: All the API’s are in the same postman collection therefore same link is added in each row)