Giter Club home page Giter Club logo

affect-bot's Introduction

Affect Bot

Bot project for Beyond Verification research group.

TO ADD NEW WORDS TO CORPUS:

Run sorting.py in the terminal, which will generate a JSON file with every script or poem included in the "python" folder. This JSON will need to be run through a validator and adjusted manually to work properly. I recommend using this one.

There is also a file called sorting-sentences.py, which will add new sentences to the corpus-s.json document in case you want to use the Markov Chain option in the JavaScript file.

The JSON files will contain the text from the script in pieces (words or sentences, depending on which one you use); the associated affects; and, for corpus.json, the part of speech of the word.

THE WEB INTERFACE

There are two options for generating phrases: one using parts of speech, and one using Markov chains (via the RiTA library). The Markov chain option is commented out at the moment. The eventual intent is to combine the two in some way.

New sentence constructions can be added in the js/bot.js file by adding to the constructions array. This should take the form of an array containing the parts of speech you want your sentence to follow, in order. I am using the UPenn tag set, default with NLTK, which is detailed here pretty nicely.

The bot is set to auto refresh the generated phrases every 5 seconds. This can be changed in the switchAffect() function in js/bot.js, as a parameter within setInterval(). If the page is refreshed, the entire history will be cleared; there is no database (everything is done client side at the moment).

affect-bot's People

Contributors

rouxpz avatar

Watchers

James Cloos avatar

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.