yenniejun commited on
Commit
9e6613e
·
1 Parent(s): 6ea75be

Updating req.txt

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. app.py +12 -2
  3. requirements.txt +2 -3
README.md CHANGED
@@ -8,7 +8,7 @@ sdk_version: 1.32.2
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
- short_description: Century classification for classical Chinese texts
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
+ short_description: Century classification for classical Korean/Chinese texts
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py CHANGED
@@ -1,12 +1,23 @@
 
 
 
 
 
 
 
1
  # https://huggingface.co/blog/streamlit-spaces
2
  # https://huggingface.co/docs/hub/en/spaces-sdks-streamlit
3
 
 
 
4
  import streamlit as st
5
  from transformers import pipeline
6
  from string import punctuation
7
  import pandas as pd
 
 
8
 
9
- # Load the pipeline with your specific model
10
  model_pipeline = pipeline(task="text-classification", model="bdsl/HanmunRoBERTa")
11
 
12
  # Streamlit app layout
@@ -20,7 +31,6 @@ remove_punct = st.checkbox(label="Remove punctuation", value=True)
20
  # Text area for user input
21
  input_str = st.text_area("Input text", height=275)
22
 
23
-
24
  # Remove punctuation if checkbox is selected
25
  if remove_punct and input_str:
26
  # Specify the characters to remove
 
1
+ """
2
+ HuggingFace Spaces that:
3
+ - loads in HanmunRoBERTa model https://huggingface.co/bdsl/HanmunRoBERTa
4
+ - optionally strips text of punctuation and unwanted charactesr
5
+ - predicts century for the input text
6
+ - Visualizes prediction scores for each century
7
+
8
  # https://huggingface.co/blog/streamlit-spaces
9
  # https://huggingface.co/docs/hub/en/spaces-sdks-streamlit
10
 
11
+ """
12
+
13
  import streamlit as st
14
  from transformers import pipeline
15
  from string import punctuation
16
  import pandas as pd
17
+ from huggingface_hub import InferenceClient
18
+ client = InferenceClient(model="bdsl/HanmunRoBERTa")
19
 
20
+ # Load the pipeline with the HanmunRoBERTa model
21
  model_pipeline = pipeline(task="text-classification", model="bdsl/HanmunRoBERTa")
22
 
23
  # Streamlit app layout
 
31
  # Text area for user input
32
  input_str = st.text_area("Input text", height=275)
33
 
 
34
  # Remove punctuation if checkbox is selected
35
  if remove_punct and input_str:
36
  # Specify the characters to remove
requirements.txt CHANGED
@@ -1,4 +1,3 @@
1
  pandas==2.0.3
2
- transformers==4.39.0
3
- tensorflow
4
- torch
 
1
  pandas==2.0.3
2
+ transformers
3
+ tensorflow