ZongqianLi commited on
Commit
56acf35
·
verified ·
1 Parent(s): acabee9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -1,6 +1,13 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
 
 
 
 
 
 
 
 
4
  # 定义模型配置选项
5
  size_lst = ["-base", "-large"]
6
  cased_lst = ["-cased", "-uncased"]
@@ -25,13 +32,15 @@ st.write(f"Your selected model: {model}")
25
  # 加载问答模型
26
  pipe = pipeline("question-answering", model=model)
27
 
 
 
28
  # 设置默认的问题和上下文
29
  default_property = "FF"
30
  default_context = "The referential DSSC with Pt CE was also measured under the same conditions, which yields η of 6.66% (Voc= 0.78 V, Jsc= 13.0 mA cm−2, FF = 65.9%)."
31
 
32
  # 获取用户输入的问题和上下文
33
  property = st.text_input("Enter your the name of the property: ", value=default_property)
34
- context = st.text_area("Enter the context: ", value=default_context, height=300)
35
 
36
  # 添加一个按钮,用户点击后执行问答
37
  if st.button('Extract the property'):
 
1
  import streamlit as st
2
  from transformers import pipeline
3
 
4
+ ##########
5
+ # Property Extraction
6
+ ##########
7
+ st.title("Extract material property from paper")
8
+
9
+ st.header("Select a model: ")
10
+
11
  # 定义模型配置选项
12
  size_lst = ["-base", "-large"]
13
  cased_lst = ["-cased", "-uncased"]
 
32
  # 加载问答模型
33
  pipe = pipeline("question-answering", model=model)
34
 
35
+ st.header("Input the paper: ")
36
+
37
  # 设置默认的问题和上下文
38
  default_property = "FF"
39
  default_context = "The referential DSSC with Pt CE was also measured under the same conditions, which yields η of 6.66% (Voc= 0.78 V, Jsc= 13.0 mA cm−2, FF = 65.9%)."
40
 
41
  # 获取用户输入的问题和上下文
42
  property = st.text_input("Enter your the name of the property: ", value=default_property)
43
+ context = st.text_area("Enter the context: ", value=default_context, height=100)
44
 
45
  # 添加一个按钮,用户点击后执行问答
46
  if st.button('Extract the property'):