TanmoySG / YourAssistant

Chatbot Backend API
2 stars 0 forks source link

Changes to the intents and other optioned fields #9

Closed TanmoySG closed 2 years ago

TanmoySG commented 2 years ago

The Ask is to

Checkpoints

How To ?

Instructions on how what and where to make changes are added below as comments ⬇️

TanmoySG commented 2 years ago

Setup

Clone the repository locally. Run these (on VSCode Terminal)

git clone https://github.com/TanmoySG/YourAssistant

cd YourAssistant

git fetch origin
git checkout intent-repair

On VS Code the branch intent-repair will be activated. Work ONLY on this branch.

TanmoySG commented 2 years ago

How to - intents.json

List Items

List Items are the things that you want the user to choose from, like when a user queries

So you need to add hod cse pattern block to the intent and simillar for pther depts. Use this block

{
    "tag": "hod-cse",
    "patterns": [
        "hod cse",
        "hod computer science"
    ],
    "responses": [
        "Dr. Amitava Nag"
    ],
    "context_set": ""
},

replace values as required . These are list items, hence you should put them together, near other items of that list, hod-ece, hod-cse, hod-ce, etc should be together.

Update department specific resources

Like here. - https://github.com/TanmoySG/YourAssistant/blob/main/intents.json#L220-L230 , remove the hod name from the list of response, and use something like this

Also, to add new blocks use this

{
    "tag": "civil-engineering",
    "patterns": [
        "civil",
        "civil-engineering"
    ],
    "responses": [
        "CE Offers (add para)"
    ],
    "context_set": ""
}

Similarly add for department list and course list.

TanmoySG commented 2 years ago

How to app.py

Also, dont add any new list, if required I'll add it.

TanmoySG commented 2 years ago

Testing

Once changes are made, test them by running. server and using curl requests.

Start the server by going to the project folder, starting the terminal and running

flask run

This should show a address localhost:PORT, as "running as

" , use this

Run sample queries

curl <address>/interact?query="<your%20query%20here"

Sample -

curl localhost:5000/interact?query="cse%20hod"

Add %20 for every gap.

  • hod cse ➡️ hod%20cse
TanmoySG commented 2 years ago

Pushing changes

Once you make the changes run on terminal

git add .
git commit -m "Changes made for issue #9"
git push