Oliviayc commited on
Commit
2cb8bbb
·
1 Parent(s): 8234e30

change some details

Browse files
.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
.idea/.name ADDED
@@ -0,0 +1 @@
 
 
1
+ scattertext_funtion.py
.idea/huggingface.iml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="inheritedJdk" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ </module>
.idea/inspectionProfiles/profiles_settings.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
.idea/misc.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Black">
4
+ <option name="sdkName" value="Python 3.9" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
7
+ </project>
.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/huggingface.iml" filepath="$PROJECT_DIR$/.idea/huggingface.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
.idea/vcs.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ <mapping directory="$PROJECT_DIR$/scattertext" vcs="Git" />
6
+ </component>
7
+ </project>
scattertext_funtion.py CHANGED
@@ -20,7 +20,8 @@ uploaded_file = st.file_uploader("Upload your text document", type=["csv", "txt"
20
  # read data
21
  if uploaded_file is not None:
22
  # choose function
23
- function_choice = st.selectbox('Choose file source', ('Choose...', 'Customized', 'Download from Online Databases'))
 
24
  # function1: generate plot from customized file
25
  if st.button('Customized'):
26
  # proceed data
@@ -29,7 +30,7 @@ if uploaded_file is not None:
29
  elif uploaded_file.name.endswith(".txt"):
30
  df = pd.read_table(uploaded_file, sep='\t') # TODO : doc: assume contents are seperated by Tabs.
31
 
32
- chosen_column = st.selectbox("Choose text column for analysis", df.head())
33
  # convert to scattertext corpus
34
  corpus = stx.CorpusFromPandas(
35
  df,
@@ -39,10 +40,8 @@ if uploaded_file is not None:
39
  ). build()
40
  # create visualization
41
  # customize parameters
42
- input_category_name = input('Enter the category name')
43
- customize_category_name = st.text_input('Customize parameter', input_category_name)
44
- input_non_category_name = input('Enter the non-category name')
45
- customize_non_category_name = st.text_input('Customize parameter', input_non_category_name)
46
  html = stx.produce_scattertext_explorer(corpus,
47
  category=chosen_column,
48
  category_name=customize_category_name,
@@ -59,7 +58,7 @@ if uploaded_file is not None:
59
  # scopus & lens
60
  if uploaded_file.name.endswith(".csv"):
61
  df = pd.read_csv(uploaded_file)
62
- chosen_column = st.selectbox("Choose text column for analysis BESIDES ABSTRACT", df.head())
63
  if chosen_column == 'Abstract':
64
  st.write("This column cannot be selected, please select again")
65
  else:
 
20
  # read data
21
  if uploaded_file is not None:
22
  # choose function
23
+ function_choice = st.selectbox('Choose file source', ['Choose...', 'Customized', 'Download from Online Databases'])
24
+
25
  # function1: generate plot from customized file
26
  if st.button('Customized'):
27
  # proceed data
 
30
  elif uploaded_file.name.endswith(".txt"):
31
  df = pd.read_table(uploaded_file, sep='\t') # TODO : doc: assume contents are seperated by Tabs.
32
 
33
+ chosen_column = st.selectbox("Choose text column for analysis", df.columns)
34
  # convert to scattertext corpus
35
  corpus = stx.CorpusFromPandas(
36
  df,
 
40
  ). build()
41
  # create visualization
42
  # customize parameters
43
+ customize_category_name = st.text_input('Enter the category name')
44
+ customize_non_category_name = st.text_input('Enter the non-category name')
 
 
45
  html = stx.produce_scattertext_explorer(corpus,
46
  category=chosen_column,
47
  category_name=customize_category_name,
 
58
  # scopus & lens
59
  if uploaded_file.name.endswith(".csv"):
60
  df = pd.read_csv(uploaded_file)
61
+ chosen_column = st.selectbox("Choose text column for analysis BESIDES ABSTRACT", df.columns)
62
  if chosen_column == 'Abstract':
63
  st.write("This column cannot be selected, please select again")
64
  else: