Coder Social home page Coder Social logo

meanna / faqbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from techx/faqbot

0.0 0.0 0.0 1.96 MB

:question: An email bot to answer FAQ

Home Page: https://medium.com/hackmit-stories/faqbot-an-open-source-email-answering-tool-from-hackmit-fb395e93589d

License: GNU Affero General Public License v3.0

Python 82.90% HTML 16.15% CSS 0.85% JavaScript 0.10%

faqbot's Introduction

faqbot

A bot to manage emails that ask frequenty asked questions.

Control Panel

Features

Canned Replies

Super simple interface to reply to an email with a canned response. Simply reply to faqbot with @faqbot <template_name> and faqbot will respond to the original email with the response.

Hackable Email Modules

Easy API to add new email bot features. Simply hook into a email_callback and use the API to do tasks and reply to emails that suit your needs.

Smart Reply

With a lot of faqbot usage from your organization, you can train a model such that faqbot can figure out how to reply on its own.

Quill Integration

If you run a hackathon and use HackMIT's quill registration system, faqbot comes pre-baked with quill integration. Whitelist email addresses right from your inbox.

And many more!

Setup

Use Python 2.7,

Resolve dependencies,

pip install -r requirements.txt

You need to place the config.py file inside the faqbot directory. We have provided an example config in the faqbot directory, config.example.py.

Running

To run for local debugging,

python app.py

To run on production,

python run.py

Usage

Control Panel

Head over to the url where you've deployed faqbot to view the control panel. There you can enable / disable features, tweak settings and add new templates.

Basic Usage

Reply all to the email thread without the person who sent the email. Or reply-one to [email protected] (or your configured mail-box) with the body text:

@faqbot latereg

This will reply to the person a generic response to "I didn't register for you hackathon before the deadline."

You can also use the @fb trigger for shorthand.

Quill

faqbot has a quill integration module (HackMIT's registration system). This is used to whitelist emails in our system.

@faqbot whitelist <email>

This will whitelist the given email in quill and reply to the person.

Smart Reply

faqbot can learn emails to template mapping and will attempt to automatically reply to an email if it's confident enough.

To use Smart Reply on your own emails, collect training data,

python tasks.py --collect

and then train the model on the collected dataset,

python tasks.py --train

Development

Writing Code

faqbot's codebase is designed to be hackable. The main directory to add a new feature is the faqbot/features/ directory. Here you can register for email callbacks and use the faqbot API to send reply-all or reply-one messages based on the email you just received.

Adding new features is extensively documented in the features module. You can also take a look at the quill feature as an example feature to go off of.

Testing

The tests right now are hidden, because they are based on emails we've received in the past and hence reveal private information. However, we do plan on anonymize them and checking them in. The tests are run as follows:

python -m unittest tests.test_parsing

Contributing

Try to use black and follow that style for everything outside of legacy/. Contribute by opening pull requests and report bugs by creating issues. Email parsing in general is nasty, so opening bugs for parsing errors will be really helpful.

License

Copyright (c) 2018-2019 Shreyas Kapur. Released under AGPLv3. See LICENSE.md for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.