Yasu777 commited on
Commit
59be2d9
·
1 Parent(s): 6351052

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -60,8 +60,8 @@ current_time = datetime.datetime.now()
60
  one_day_ago = current_time - datetime.timedelta(days=1)
61
  db.remove(Query().timestamp.test(lambda x: datetime.datetime.fromisoformat(x) <= one_day_ago))
62
 
63
- st.title("記事生成ウェブアプリ")
64
- st.write("このアプリは、与えられたキーワードを使用して記事を生成します。")
65
 
66
  new_keyword = st.text_input("キーワード:")
67
  keyword_id = re.sub(r"\W+", "", new_keyword) if new_keyword else None
@@ -100,9 +100,9 @@ if keyword_id:
100
  else:
101
  editable_output2 = ""
102
 
103
- if st.button("記事構成作成", key=f"run_button_{keyword_id}"):
104
  try:
105
- with st.spinner("タイトル・見し作成中..."):
106
  urls, keyword = get_top_urls_and_keyword(new_keyword)
107
  url1, url2, url3 = urls
108
 
@@ -124,7 +124,7 @@ if keyword_id:
124
  db.upsert({"name": "output1.txt", "content": content, "keyword_id": keyword_id},
125
  (Query().name == "output1.txt") & (Query().keyword_id == keyword_id))
126
 
127
- with st.spinner("その他の処理を実行中..."):
128
  process = subprocess.Popen(["python3", "second.py", keyword])
129
  process.wait()
130
 
@@ -153,9 +153,9 @@ if keyword_id:
153
 
154
  editable_output2 = st.text_area("output2.txtを編集してください:", value=editable_output2)
155
 
156
- if st.button("記事作成"):
157
  try:
158
- with st.spinner("記事作成中..."):
159
  subprocess.run(["python3", "run_third.py", editable_output2, keyword_id], check=True)
160
 
161
  with open("output3.txt", "r", encoding="utf-8") as f:
 
60
  one_day_ago = current_time - datetime.timedelta(days=1)
61
  db.remove(Query().timestamp.test(lambda x: datetime.datetime.fromisoformat(x) <= one_day_ago))
62
 
63
+ st.title("Baby Writter")
64
+ st.write("こちらは、与えられたキーワードを使用して生成します。")
65
 
66
  new_keyword = st.text_input("キーワード:")
67
  keyword_id = re.sub(r"\W+", "", new_keyword) if new_keyword else None
 
100
  else:
101
  editable_output2 = ""
102
 
103
+ if st.button("構成作成", key=f"run_button_{keyword_id}"):
104
  try:
105
+ with st.spinner("キーワード、主題抽出中..."):
106
  urls, keyword = get_top_urls_and_keyword(new_keyword)
107
  url1, url2, url3 = urls
108
 
 
124
  db.upsert({"name": "output1.txt", "content": content, "keyword_id": keyword_id},
125
  (Query().name == "output1.txt") & (Query().keyword_id == keyword_id))
126
 
127
+ with st.spinner("タイトル、見出し作成中..."):
128
  process = subprocess.Popen(["python3", "second.py", keyword])
129
  process.wait()
130
 
 
153
 
154
  editable_output2 = st.text_area("output2.txtを編集してください:", value=editable_output2)
155
 
156
+ if st.button("本文作成"):
157
  try:
158
+ with st.spinner("本文作成中..."):
159
  subprocess.run(["python3", "run_third.py", editable_output2, keyword_id], check=True)
160
 
161
  with open("output3.txt", "r", encoding="utf-8") as f: