Giter Club home page Giter Club logo

watson-ta's Introduction

Watson-TA

Build Status

What is Watson TA

We plan on making the Watson TA. It will be a web app where students can upload a school assignment (homework, quiz, test, etc.) and help the student complete the assignment. The app will provide a structured interface for answer exploration and completion providing structured parsing, drag and drop answer composition, etc. Culminating in the students ability to export the finished assignment for submission.

Don't want to download the app? View the final UI and feature documentation here in slide form.

Setup

Watson TA Docker

  1. Clone and cd into the watson-ta repository (e.g. pwd should end in watson-ta/)
  2. Add the API keys to a .keys.sh file (placed in watson-ta/)
## The keys required for Watson-TA
# NLC
export watson_username=''
export watson_password=''

# Alchemy
export watson_alchemy_key=''

# Retrieve and Rank
export watson_rr_username=''
export watson_rr_password=''
export watson_rr_cluster_id=''

# Document Conversion
export watson_dc_username=''
export watson_dc_password=''

# Github
export github_username=''
export github_password=''
  1. Build the container by running:
# Builds a container named "watson-ta" from the Dockerfile at . (e.g. the current directory)
docker build -t watson-ta .
  1. Enter the container by running:
# Mounting the watson-ta local repo & keys to enable active development
# Map the docker port `0.0.0.0:8000` to local port `127.0.0.1:8000`
# Enter an interactive terminal session of bash on the container
docker run -it --rm -v `pwd`:/app/ -p 127.0.0.1:8000:8000 watson-ta /bin/bash
  1. You should now be within the watson-ta docker container!
  2. Run the alias up to setup remaining configuration and boot the django server. The up command does the following:
# Notice: These are bash aliases defined in the .docker-setup.sh :)
# Run all within: /app/www/
# What up runs for you:
keys       # Load the keys
csu        # Create superusers
           #   username:   admin
           #   password:   watsonta
           #   email:      [email protected]
webpack    # Execute webpack using the `webpack.config.js`
serve      # Execute the alias serve
  1. Navigate to localhost:8000 in a browser to interact with Watson TA application
  2. The login is the following:
username = "admin"
password = "watsonta"
email    = "[email protected]"
  1. Develop away with hot reload!
  2. If you need to recompile the JavaScript use rb to rebuild the JavaScript and rerun the server

Testing

Run unit tests with pytest in the root /app directory within Docker:

root@d8f3d21c1533:/app# pytest
================================================ test session starts =================================================
[ . . . ]
============================================== n passed in 1.23 seconds ==============================================

Travis Continuous Integration will also run the testing suite on all commits and pull requests!

The Team

Team: Sign of the Horns (aka ๐Ÿค˜)

Dalton Flanagan Liv Stanley Bill Varcho Tyler Zeller David Soller
github.com/dltn github.com/livstanley29 github.com/Varcho github.com/tylermzeller github.com/3ygun
Dalton Leb Bill Tyler... David

watson-ta's People

Contributors

3ygun avatar dltn avatar livstanley29 avatar tylermzeller avatar varcho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

3ygun

watson-ta's Issues

Question Parsing

screen shot 2017-04-18 at 1 15 21 pm

It seems the current parsing only looks for a, b, c, or d followed by a '.'

Probably a regex fix.

Database to Store Files

Goals

We have user accounts lets use them! Investigate what database to use Sqlite? Postgress or MySQL? Mongo? etc.

Aspects

  • Database picked with reasoning
  • Files stored

Question Parsing Accuracy

Goal

Parsing isn't the best right now we should improve it!

History

Old extract question method

def extract_questions(text):
    text = text.replace('\t', ' ')
    pattern = '[0-9]+(\)|\.)(?:(?![0-9]+(\)|\.)).)*'
    res = [match.group(0) for match in re.finditer(pattern, text)]
    obj_res = []
    for r in res:
        rmap = {
            'class_name': 'TF',
            'confidence': 0.0
        }
        # todo get classified result
        obj_res.append(Classified(r[4:-1], rmap).get_map_repr())
    # order questions and classify
    return obj_res

Regex Attempts

Had some example cases here

MC Choices Parsing

  • Attempt at ABCD and abcd resolution: (?P<choice>(?:.(?!(([ABCD][\.\)\:])|([abcd][\)\:]))))*)

Parse out question

  • Mostly works but gets extra (?:(\d+[\.](.(?!(\d+[\.])))*))
  • Doesn't split on lines (?:(\d+[\.].*))
  • Final working (\d+\..+?(?:(?=(?:\d+\.))|(\n|\r)))
    • Parses number questions for splitting! ๐ŸŒต

Linting and Formatting

Goals

Auto linting and formatting for our code in:

  • python
  • javascript

Why? >> Consistency and readability improvements

Pieces

  • Python linter/formatter >> pylint? Is what I've used in the past
  • Javascript linter/formatter >> unknown off the top of my head

Class Creator

Goals

Have a class creation UI allowing one to upload Texts, HWs, and Quizes for Students

  • Dependent on database file strogae

Get all the Data

Goal

Get all the data for learning, prediction, etc.

  • Demo data
    • NLC -- Test Guestions
    • Rank & Retrieve -- Harry Potter
  • Real data
    • Textbook parsing tool?

Data

Harry Potter Demo

Goals

  • Upload Harry Potter Quiz PDF
  • Parse PDF Questions into their question type
  • Allow for answering of questions
  • Have button to place either Alchemy main points or question into retrieve and rank

MVP - File Editor

Goals

Create our mvp file upload and editing interface. Similar to the mock-up:
watson ta

Parts

Notice: I originally though we'd do more stuff client side in JavaScript instead we're doing server side processing in Python. As such must of the suggested tools are irrelevant but I'm leaving them just in case. The main points are still accurate:

  • File upload & parsing (only allow .pdf uploads to make easy parsing?)
  • File download on editing completion (.pdf)
  • Editing (and live update?)
    • Use PDFmake Javascript Library as it has a nicer usage interface than jsPDF just look at the examples of both. Also the PDFmake's demo actually loads on Firefox which is a plus
  • UI with navigation and and movement >> Using Bootstrap 4 the shinny new Bootstrap because we wanted the flex-boxes โค๏ธ. Just normal CSS not SCSS as we currently don't have too many styles....
    • Preferred if we use Bootstrap in SCSS version however if someone has another prettier CSS library that is fine
  • Dynamic updates on the page >> We've chosen ReactJS due to its ubiquity over Vue & familiarity to the Facebook crew

Docker

Goals

Dockerized container for development and production?

  • Development
    • Basic Dockerfile & run instructions
    • Makefile or Docker commands for quicker build & run
  • Production

Bug: Drag and Drop text it's stored into state

Problem

When text is dragged to a box it appears to be placed into the objects context however the data is not saved to the objects state as seen when trying to download the resulting PDF.

Parts

  • Implement state saving on drag-and-drop text
  • Validate that the text appears on a exported/downloaded PDF
  • Validate that the text doesn't disappear on component refresh (when the search button is refreshed)

UI Tweeks

Goals

Improve the UI.

Parts

  • Add way to change question classification?
  • Fix CSS on smaller screens
  • Make biology knowledge base the primary
  • Eliminate the User Side Menu

Bad Question Parsing

Problem

bio_hw2.pdf's question 11 doesn't get parsed correctly. See below:

watsonta--bad-question-parsing

The parse trace within the console is as follows:

Raw Question:  ['no title', '1. Which of the following statements is false? a. Molecules with the formulas CH3CH2COOHd C3H6O2 could be structural isomers.', 'b. Molecules must have a double bond to be cis-trans isomers. c. To be enanters, a molecule must have at least three different atoms or groups connected to a central carbon.', 'd. To be enantios, a molecule must have at least four different atoms or groups connected to a central carbon.', '2. If xenon has anmic number of 54 and a mass number of 108, how many neutrons does it have?', 'a. 54 b. 27 c. 100 d. 108', '3. Atoms t vary in the number of neutrons found in their nuclei are called ________.', 'a. ions b. neutrons c. neutral atoms d.otopes', '4. Potassium has an atomic number of ', '19. What is its electron configuration?', 'a. shells 1 and 2 are f, and shell 3 has nine electrons b. shells 1, 2 and 3 are full and shell 4 has three electrons c. shells 1, 2 and 3 afull and shell 4 has one electron d. shells 1, 2 and 3 are full and no other electrons are present', '5. Which type oond represents a weak chemical bond? a. hydrogen bond', 'b. atomic bond c. covalent bond d. nonpolar ovalent bond',  Which of the following statements is not true? a. Water is polar.', "b. Water stabilizes temperature. c. ater is estial fr life. d. Water is the most abundant molecule in the Earth's atmosphere.", '7. When acids are added to a solun, the pH should ________. a. decrease', 'b. increase c. stay the same d. cannot tell without testing', '8. A molecul that binds up excess hydrogen ions in a solution is called a(n) ________.', 'a. acid b. isotope c. base d. donator', 'Which of the following statements is true? a. Acids and bases cannot mix together.', 'b. Acids and bases will neutral each other. c. Acids, but not bases, can change the pH of a solution. d. Acids donate hydroxide ions (OH-); bases doe hydrogen ions (H+).', '10. Each carbon molecule can bond with as many as________ other atom(s) or molecule(s).', 'ane b. two c. six d. four 11. Which of the following is not a functional group that can bond with carbon?', 'a. sodium hydroxyl c. phosphate d. carbonyl', '12. What makes ionic bonds different from covalent bonds?', '13. Why are hydrogbonds and van der Waals interactions necessary for cells?', '14. Discuss how buffers help prevent drastic swings in p, '15. Why can some insects walk on water?', '16. What property of carbon makes it essential for organic life?', '17. mpare and contrast saturated and unsaturated triglycerides.']

Parsing Choices
Parsing Choices
Parsing Choices
Parsing Choices
Parsing Choices
Parsing Choices
Parsing Choices
Parsing Choices
Parsing Choices
Parsing Choices
Parsing Choices
Parsing Choices

prompt': '1. Which of the following statements is false?', 'type': {'class_name': 'MC', 'confidence': 1}, 'choices': . Molecules with the formulas CH3CH2COOH and C3H6O2 could be structural isomers.', 'b. Molecules must have a double b to be cis-trans isomers.', 'c. To be enantiomers, a molecule must have at least three different atoms or groups conned to a central carbon.', 'd. To be enantiomers, a molecule must have at least four different atoms or groups connectto a central carbon.']}, {'prompt': '2. If xenon has an atomic number of 54 and a mass number of 108, how many neutrodoes it have?', 'type': {'class_name': 'MC', 'confidence': 1}, 'choices': ['a. 54', 'b. 27', 'c. 100', 'd. 108']}, {'mpt': '3. Atoms that vary in the number of neutrons found in their nuclei are called ________.', 'type': {'class_name'MC', 'confidence': 1}, 'choices': ['a. ions', 'b. neutrons', 'c. neutral atoms', 'd. isotopes']}, {'prompt': '4. Potium has an atomic number of ', 'type': {'class_name': 'SA', 'confidence': 0}, 'choices': []}, {'prompt': '19. What iss electron configuration?', 'type': {'class_name': 'MC', 'confidence': 1}, 'choices': ['a. shells 1 and 2 are full, ashell 3 has nine electrons', 'b. shells 1, 2 and 3 are full and shell 4 has three electrons', 'c. shells 1, 2 and 3 a full and shell 4 has one electron', 'd. shells 1, 2 and 3 are full and no other electrons are present']}, {'prompt':
 Which type of bond represents a weak chemical bond?', 'type': {'class_name': 'MC', 'confidence': 1}, choices': ['a. drogen bond', 'b. atomic bond', 'c. covalent bond', 'd. nonpolar covalent bond']}, {'prompt': '6. Which of the follow statements is not true?', 'type': {'class_name': 'MC', 'confidence': 1}, 'choices': ['a. Water is polar.', 'b. Waterabilizes temperature.', 'c. Water is essential for life.', "d. Water is the most abundant molecule in the Earth's atmhere."]}, {'prompt': '7. When acids are added to a solution, the pH should ________.', 'type': {'class_name': 'MC', 'fidence': 1}, 'choices': ['a. decrease', 'b. increase', 'c. stay the same', 'd. cannot tell without testing']}, {'pro': '8. A molecule that binds up excess hydrogen ions in a solution is called a(n) ________.', 'type': {'class_name':', 'confidence': 1}, 'choices': ['a. acid', 'b. isotope', 'c. base', 'd. donator']}, {'prompt': '9. Which of the follng statements is true?', 'type': {'class_name': 'MC', 'confidence': 1}, 'choices': ['a. Acids and bases cannot mix toher.', 'b. Acids and bases will neutralize each other.', 'c. Acids, but not bases, can change the pH of a solution.',. Acids donate hydroxide ions (OH-); bases donate hydrogen ions (H+).']}, {'prompt': '10. Each carbon molecule can bowith as many as________ other atom(s) or molecule(s).', 'type': {'class_name': 'MC', 'confidence': 1}, 'choices': ['ane', 'b. two', 'c. six', 'd. four 11. Which of the following is not a functional group that can bond with carbon?', 'sodium', 'b. hydroxyl', 'c. phosphate', 'd. carbonyl']}, {'prompt': '12. What makes ionic bonds different from covale
bonds?', 'type': {u'class_name': u'SA', u'confidence': 0.9918424343418958}, 'choices': []}, {'prompt': '13. Why are hogen bonds and van der Waals interactions necessary for cells?', 'type': {u'class_name': u'SA', u'confidence': 0.9927890316799}, 'choices': []}, {'prompt': '14. Discuss how buffers help prevent drastic swings in pH.', 'type': {u'classme': u'SA', u'confidence': 0.9905597980072548}, 'choices': []}, {'prompt': '15. Why can some insects walk on water?',ype': {u'class_name': u'SA', u'confidence': 0.9925447756894641}, 'choices': []}, {'prompt': '16. What property of car makes it essential for organic life?', 'type': {u'class_name': u'SA', u'confidence': 0.9904807597738576}, 'choices':}, {'prompt': '17. Compare and contrast saturated and unsaturated triglycerides.', 'type': {u'class_name': u'SA', u'cidence': 0.7716970958001745}, 'choices': []}]

Retrieve and Rank

Goal

  • Get the service running
    • Distribute password
  • Find data
  • Integrate service

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.