NLP Engine Service

Overview

In the existing version of the chatbot, for PGR complaint creation feature, the user has to select his/her 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, 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 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 VariablesDescription

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 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

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

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

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

Reference Docs

Title

API List

APIs

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

All content on this page by eGov Foundation is licensed under a Creative Commons Attribution 4.0 International License.