-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create FB bot that will answer qs about Nepal data #118
Comments
This is a great idea @ravinepal. I will do some research on this. Love it. |
@prashishh -- i wanted to see if you got chance to look into this or ask other c4n members to do so |
@prashishh it'd be great have a team working on this? We can give them access to our FB page and they can start working on this :) |
I think the MVP of FB bot could just simply direct people to the link of certain district, VDC or municipality. for example, when someone asks how many people have education in Kavre. If someone asks about a neighborhood and we don't have that location in our database, FB bot could respond by saying: "Hmm can you tell me which VDC, Municipality or district, your location is in, and I can find related data for you." I believe this FB bot could be very useful especially to students, and reporters. Looping @Studenton and @cliftonmcintosh in the conversation for their thoughts, and see if they know someone who would be interested in doing this! |
I have a suggestion. If you don't want to code all of this there's a better solution. Get your bot up and running in a few minutes, anyone can do it. |
ofcourse its possible way to do... we can train our chatbot ourselves on how it will respond to our users when they input certain keywords. |
@mesaugat @ksodari - Thanks for the heads up. I went through ChatFuel and it was fairly easy to set up a basic chatbot. I think it is great for a tree-based conversation for Code for Nepal, but I'm curious if you have worked on integrating this with a datastore? There is an integration with Google Sheets or a JSON API. They can act like a data store if someone searches for the term - tell me about "a district" / what is the population of "a district" (advanced). The census data are stored in the form of csv in this repo (https://github.com/Code4Nepal/data/tree/master/datasets/census). Do you think we can save them in an easy-to-deploy-and-test datastore to fetch these information for the chatbot? |
Not worked with the JSON API in Chatfuel but just had a quick look. Only having the dataset won't do us any good. We'll need to create an API of our our own for the dataset so that we can query our API when someone asks about the census for a district. For Example: If someone asks: {
"district": "Siraha",
"population": 637328,
"year": 2011
} and return a text to the user. Bot: We could change this JSON response as Chatfuel wants it to be, mentioned here. Even if we were creating our own bot we would be doing something similar. Hopefully, this helps. |
thanks, guys! let me bring @cliftonmcintosh to the convo as he is the expert on NepalMap and can perhaps guide us on how to efficiently create an API for NepalMap. |
I'm not sure what it would take to expose an API. I glanced through the Wazimap code and don't see anything, but Census Report, on which Wazimap is based, has an api: https://github.com/censusreporter/census-api I'm not sure how it is used since both Census Reporter and Wazimap seem to deliver templated HTML views for each request. A JSON API is likely not something that comes with our framework. |
Hello everyone. I have been following this issue. And i guess chatfuel isn't the best option available given it has free usage limit. The main advantage of api.ai here are
One thing to note here. For any chatbot framework to show dynamic response, we will need api (or data access code to feed to bot). As mentioned by @mesaugat I don't know anything about Wazimap or Census report. But I guess, we can add REST APIs to django using REST framework. Technically its Django right? @cliftonmcintosh |
The problem is not Chatfuel. It's free as well unless you hit too many users.
Yes, https://api.ai/ is great. It has a lot of integrations. But the ease of Chatfuel is big, anyone can configure anything. No wonder it's getting popular. You don't need to deploy a bot unlike api.ai and other services. If we are planning for custom use cases then we can definitely go for api.ai. That being said we can choose any service. The pain point here is we don't have an API to query the census data. From what I see we already have various census data's in CSV format. We just need to feed that data into a database and create a fairly simple API which should not take time. The census API doesn't not even need to be in this repository. It could be a simple app in any language deployed somewhere and we just query from it. UPDATE: As @ravinepal mentioned above:
I think we don't even need an API for doing something like this. Just map a location name with their corresponding Nepal Map URL in Chatfuel. It should be fairly simple? @prashishh That means: 'Kathmandu' will be mapped as http://www.nepalmap.org/profiles/district-27-kathmandu/ in Chatfuel. I think this is possible. If someone asks: Census of kathmandu? That's seems to be what we need, no? |
I explored how Wazimap library is developed internally in venv/lib/python2.7/site-packages/wazimap/views.py and found that Wazimap already implements the census-reporter API and gives a endpoint. So I can access the projected population of Kathmandu for 2031 as It gives back a JSON response.
|
That's an interesting find, @Studenton |
Thank you, @mesaugat, @vksbhandary, @cliftonmcintosh. and special thanks to @Studenton for that find :) We have a prototype of a bot that @ksodari and I created using Chatfuel - let me know if you guys would be interested in accessing it or contributing to it. If you just want to test it, type "Code for Nepal" in your FB messenger and let us know what you think @ksodari - can we use text card to map URLs as @mesaugat is suggesting? |
Great! Maybe not. Text cards only seem to support texts. There's a gallery card that definitely supports a URL. |
@ravinepal yes Sir! Gallery card can be used very efficiently on this as mentioned by @mesaugat . |
hi @cliftonmcintosh - grateful if you could kindly advise @ksodari. pls see his comment #118 (comment) |
Apologies for missing your question. Data in NepalMap is kept in a postgres database on the same server as the webapp. The database is not exposed externally. When new data points are added, tables are created and data is updated via SQL statements. The SQL statements are here. Does that provide you with the information you need? |
thanks, @cliftonmcintosh. @ksodari does that help? @amitness - would you have time to help @ksodari build API? |
Sure @ravinepal @ksodari . How are you guys coordinating on this and what's the current status? |
hi everyone, it'd be great to restart this project. @ksodari - happy to chat if you are still interested. |
hi @ravinepal. would you provide me on more info on what enhancements you need for your bot? i can work with AI and Markov models, if that's on your scope. |
thanks a lot, @wizofe! We have a prototype of a bot that we created using Chatfuel. If you just want to test it, type "Code for Nepal" in your FB messenger and let us know what you think. Or test via our page by sending us a message: https://www.facebook.com/codefornepal/ Basically, we are trying to make a bot respond to users' queries about data on Nepal. We have tons of Nepal data here: https://nepalmap.org I think the MVP of FB bot could just simply direct people to the link of certain district, VDC or municipality on https://nepalmap.org for example, when someone asks how many people have education in Kavre. If someone asks about a neighborhood and we don't have that location in our database, FB bot could respond by saying: "Hmm can you tell me which VDC, Municipality or district, your location is in, and I can find related data for you." I believe this FB bot could be very useful especially to students, and reporters. Does this help? I'm also open to other ideas! |
You can easily create AIML structures to best match user queries and then respond with the data you have instead of providing a link. I built a similar bot for Kathmandu University. https://github.com/rajsanjib/KU-Bot |
@ravinepal Sure! Currently most of us here in the Bay Area have been working around the Akshar digital literature portal. But I remember a few folks expired desires work on this in the past. I'll double check if anyone is still interested |
well i think creating a chatbot is a nice idea but n facebook, they do have a platform called chatfuel which is intended for creation of chatbots and linking the to a particular page on facebook. fb does charge on that but trust me its worth it because facebook would itself want to improve in every possible day, it is the biggest step for creating chatbots without any coding |
is it possible that we program a fb bot in a way that would respond to user's data related questions if there's info on NepalMap?
if it's useful here's white house fb chatbot: https://github.com/WhiteHouse/fb_messenger_bot
The text was updated successfully, but these errors were encountered: