Spaces:
Runtime error
Runtime error
Merge pull request #6 from panotedi/milestone-2
Browse files- .github/workflows/main.yml +20 -0
- README.md +8 -7
- app.py +13 -0
.github/workflows/main.yml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Sync to Hugging Face hub
|
2 |
+
on:
|
3 |
+
push:
|
4 |
+
branches: [main]
|
5 |
+
|
6 |
+
# to run this workflow manually from the Actions tab
|
7 |
+
workflow_dispatch:
|
8 |
+
|
9 |
+
jobs:
|
10 |
+
sync-to-hub:
|
11 |
+
runs-on: ubuntu-latest
|
12 |
+
steps:
|
13 |
+
- uses: actions/checkout@v3
|
14 |
+
with:
|
15 |
+
fetch-depth: 0
|
16 |
+
lfs: true
|
17 |
+
- name: Push to hub
|
18 |
+
env:
|
19 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
20 |
+
run: git push https://panotedi:[email protected]/spaces/panotedi/milestone2 main
|
README.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
1 |
+
title: Milestone2
|
2 |
+
emoji: 🐢
|
3 |
+
colorFrom: blue
|
4 |
+
colorTo: red
|
5 |
+
sdk: streamlit
|
6 |
+
sdk_version: 1.17.0
|
7 |
+
app_file: app.py
|
8 |
+
pinned: false
|
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
st.title("CS634 - milestone2 - Tedi Pano")
|
3 |
+
|
4 |
+
text_input = st.text_input("Enter in a sentence for sentiment analysis" , "")
|
5 |
+
|
6 |
+
from transformers import pipeline
|
7 |
+
|
8 |
+
sentiment_model = pipeline("sentiment-analysis")
|
9 |
+
|
10 |
+
output = sentiment_model(text_input)
|
11 |
+
|
12 |
+
if text_input != "":
|
13 |
+
st.write("The sentiment analysis for '" + text_input+ "' is " + output[0]['label'] + " with a certainty score of " + str(output[0]['score']))
|