Inspiration
Finding your next meal isn't easy if there are no supermarkets around. If you do not even know who is selling what, it get's even more complicated.
A marketplace like Ebay would be nice, but what do you do without Internet?
Our solution enables farmers to spread their selling offers and users to search for offers using a natural language chat bot completely based on SMS messages.
What it does
Users can register themselves with their name, a position and whether they want to sell stuff or only buy things. The bot will guide them through the process. After the registration, the account is bound to the mobile phone number.
After registration, farmers can create selling offers for an amount of a product and a specific price. Users can search for amounts of products the same way. If there is an offer available, it is automatically reserved for the user and the farmer is notified.
Finally, the buyer and the seller meet each other and execute the purchase.
How we built it
Backend Database: https://www.postgresql.org/
All users, offers and transactions get stored.
SMS service: https://www.twilio.com
Unfortunately, German and many other mobile numbers need an account verification using an official document. Therefore, we bought ourselves a Swedish mobile number. To react on ingoing messages using a bot, we have hosted a Go app serving a public HTTP API that was used as callback for our bought number.
Intent and Entity Analysis: https://cai.tools.sap
SAP has created a nice github-like UI, in which we created a project, specified our intents and our custom 'product' entity. Then we inserted around 40 sentences for each intent, excessively using teh recommendations. The classification model was automatically trained in the background.
REST APIs
As soon as our bot is called by the Twilio servers, we are sending the message content to the SAP CAI, which returns the most probable intent and all found entities. In long switch case statements we are going through all possible intents, interacting where necessary with the database, until we finally send a response to the initial Twilio request with our response to the user.
Challenges we ran into
Many numbers require a personal verification, so we chose Sweden and the United Kingdom, because they have validation-free numbers.
SMS are very expensive (4-9 cent per outgoing SMS), so we created another number.
Google CloudFunctions are slowly starting, so we switched to our own server.
Some sentences were misclassified by our chat bot, because chat bots can never have enough training data.
Setting up a database is unnecessarily complicated, so we used a Google hosted database for some cents.
Debugging REST APIs is really annoying...
SQL statements are quickly dying...
Accomplishments that we're proud of
The idea is quite simple and the code did at least not completely explode.
The basic structure was running quite early, so we could even get some sleep. The main logic followed soon.
What we learned
APIs are a very convenient way to get difficult tasks like intent analysis done. Cloud platforms can do many tasks even much better than we can do them on a Hackathon.
Go is very convenient for API-based tasks. Also Cloud Functions can be turned quickly into a web server (using only 2 lines).
What's next for Chat4Bread
The matching logic for buyers should be improved. Also, chat bots can never have enough training data.
Try it out
+46 76 944 91 21 (beware: SMS to Sweden may be cost intensive)
Log in or sign up for Devpost to join the conversation.