ayethuzar commited on
Commit
518b2cf
1 Parent(s): 64f600d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py CHANGED
@@ -13,6 +13,25 @@ st.title('Can I Patent This?')
13
 
14
  st.write("This model is tuned with all patent applications submitted in Jan 2016 in [the Harvard USPTO patent dataset](https://github.com/suzgunmirac/hupd)")
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  tuple_of_choices = ('patent_number', 'title', 'background', 'summary', 'description')
17
 
18
  # steamlit form
 
13
 
14
  st.write("This model is tuned with all patent applications submitted in Jan 2016 in [the Harvard USPTO patent dataset](https://github.com/suzgunmirac/hupd)")
15
 
16
+ # to upload a .csv file
17
+ uploaded_file = st.file_uploader("Choose a file")
18
+ if uploaded_file is not None:
19
+ # To read file as bytes:
20
+ bytes_data = uploaded_file.getvalue()
21
+ st.write(bytes_data)
22
+
23
+ # To convert to a string based IO:
24
+ stringio = StringIO(uploaded_file.getvalue().decode("utf-8"))
25
+ st.write(stringio)
26
+
27
+ # To read file as string:
28
+ string_data = stringio.read()
29
+ st.write(string_data)
30
+
31
+ # Can be used wherever a "file-like" object is accepted:
32
+ dataframe = pd.read_csv(uploaded_file)
33
+ st.write(dataframe)
34
+
35
  tuple_of_choices = ('patent_number', 'title', 'background', 'summary', 'description')
36
 
37
  # steamlit form