Coder Social home page Coder Social logo

learningactivities's Introduction

LearningActivities

This is a set of 2 activities built for Maydm to teach Machine Learning and Aritificial Intelligence (ML/AI) concepts through code and active usage.

Activity 1: Sentiment Detection / Text Classification

The goal of this activity is to create a Bag of Words (BoW) language model which can tell whether a word, phrase, or sentence is happy or sad (or good or evil, spam or not spam, funny or cringe, Bluey, Avatar: The Last Airbender, or Law and Order, or anything else you can think of). We generally call each of these options a "sentiment", "class", or "classification".

A bag of words means we're treating each word as if it were just thrown into a bag. So we don't use the orderings of words or what context they appear in, just whether the words appear or not.

To this end, we'll implement 3 functions:

  • prompt.count_words (given a list of words in a sentence, count # of times each word appears)
  • learn.score_sentiments (given word counts in a sentence and in all sentiment, calculate the matching score per sentiment)
  • learn.classify_sentiment (given word counts in a sentence and in all sentiments, find the highest matching score)

Once these are completed, we can run python learn.py to label some data for our AI to know how to classify our sentiments. Once we've labeled some data, we can run test.py to test out our AI and see how it performs on unseen sentences.

Activity 2: Image Classification

Images are very different than text, so we handle them very differently in Machine Learning. We provide an existing trained model on the Quickdraw Dataset, a fine-tuning system for drawing your own individual drawings, and a simply drawing game where you can draw some artwork and the model will tell you what it is in real-time. We can create our own drawings with python label_data.py and test out the trained model with python classification_game.py. You can toggle on and off the fine-tuning (using your own drawings) and whether to use all the possible classes, or just the ones that you've tuned on with the boolean (True or False) values at the top of classification_game.py.

Resources

learningactivities's People

Contributors

tjkairos avatar

Watchers

 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.