Closed TanmoySG closed 2 years ago
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.
Go to intents.json in vscode.
You need to add a few things
Lists Definitions like "hod-list", "department-list" . Add others as required.
To add lists use this json block and add it just below existing lists. Below this line
{
"tag": "<listame>-list",
"patterns": [
"<pattern>"
],
"responses": [
"choose_<what you need the user to choose>"
],
"context_set": ""
}
Replace the listname with the name of the data you want a list for, eg, hod, dept, course
Replace pattern with the pattern you want the user to use
replace the <what you need the user to choose>
with the list you want the user to see, eg, if you query hod, you want the user to choose from department, so for hod list/pattern you want user to see department list.
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.
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.
course_list = [
"b.tech",
"bba",
"bsc" #like this
]
Also, dont add any new list, if required I'll add it.
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 thisRun sample queries
curl <address>/interact?query="<your%20query%20here"
Sample -
curl localhost:5000/interact?query="cse%20hod"
Add %20
for every gap.
Once you make the changes run on terminal
git add .
git commit -m "Changes made for issue #9"
git push
The Ask is to
Checkpoints
How To ?
Instructions on how what and where to make changes are added below as comments ⬇️