Coder Social home page Coder Social logo

hendrikstrobelt / sentimenter_minimal_hai Goto Github PK

View Code? Open in Web Editor NEW
33.0 3.0 6.0 114 KB

Minimal starting point for rapid prototyping interactive Human-AI tools

License: Apache License 2.0

HTML 70.24% Python 29.76%
ai xai human-computer-interaction

sentimenter_minimal_hai's Introduction

A minimal starting point for rapid prototyping interactive Human-AI tools

Just a quick connection of the huggingface pipeline for sentiment analysis (see here) with a small visual interface made with D3js.

by Hendrik Strobelt (MIT-IBM Watson AI Lab)

Perequisits

Create new Conda environment:

conda create -n hugging python=3.6
conda activate hugging

install flask:

conda install -c anaconda flask

install huggingface (and pytorch):

conda install pytorch -c pytorch
pip install transformers

Run

conda activate hugging
python server.py

visit http://localhost:8888

sentimenter_minimal_hai's People

Contributors

hendrikstrobelt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sentimenter_minimal_hai's Issues

Readme instructions may needs updation

Running python server.py command throws following error:
Neither PyTorch nor TensorFlow >= 2.0 have been found.Models won't be available and only tokenizers, configurationand file/data utilities can be used.

Please update readme for tensorflow/ pytorch dependency.

Error on running server.py

Installed tensorflow, but Getting error on running the server
Traceback (most recent call last):
File "/Users/rohitdhamija/opt/miniconda3/envs/hugging/lib/python3.6/site-packages/transformers/configuration_utils.py", line 242, in get_config_dict
raise EnvironmentError
OSError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "server.py", line 17, in
nlp = pipeline('sentiment-analysis')
File "/Users/rohitdhamija/opt/miniconda3/envs/hugging/lib/python3.6/site-packages/transformers/pipelines.py", line 1858, in pipeline
tokenizer = AutoTokenizer.from_pretrained(tokenizer)
File "/Users/rohitdhamija/opt/miniconda3/envs/hugging/lib/python3.6/site-packages/transformers/tokenization_auto.py", line 206, in from_pretrained
config = AutoConfig.from_pretrained(pretrained_model_name_or_path, **kwargs)
File "/Users/rohitdhamija/opt/miniconda3/envs/hugging/lib/python3.6/site-packages/transformers/configuration_auto.py", line 203, in from_pretrained
config_dict, _ = PretrainedConfig.get_config_dict(pretrained_model_name_or_path, **kwargs)
File "/Users/rohitdhamija/opt/miniconda3/envs/hugging/lib/python3.6/site-packages/transformers/configuration_utils.py", line 251, in get_config_dict
raise EnvironmentError(msg)
OSError: Can't load config for 'distilbert-base-uncased-finetuned-sst-2-english'. Make sure that:

  • 'distilbert-base-uncased-finetuned-sst-2-english' is a correct model identifier listed on 'https://huggingface.co/models'

  • or 'distilbert-base-uncased-finetuned-sst-2-english' is the correct path to a directory containing a config.json file

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.