pizzagatakasugi commited on
Commit
8458e2d
·
1 Parent(s): 05d24d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -13,7 +13,7 @@ st.title("将棋解説文の自動生成")
13
  df = pd.read_csv("./dataset10.csv")
14
  num = st.text_input("0から9の数字を入力")
15
 
16
- if num in list(range(10)):
17
  df = df.iloc[int(num)]
18
  st.write(df["game_type"],df["precedence_name"],df["follower_name"])
19
  sfen = df["sfen"].split("\n")
@@ -27,6 +27,11 @@ if num in list(range(10)):
27
  else:
28
  te.append(sfen[x])
29
  board = cshogi.Board()
30
- st.markdown(board.to_svg(), unsafe_allow_html=True)
 
 
 
 
 
31
 
32
 
 
13
  df = pd.read_csv("./dataset10.csv")
14
  num = st.text_input("0から9の数字を入力")
15
 
16
+ if num in [str(x) for x in list(range(10))]:
17
  df = df.iloc[int(num)]
18
  st.write(df["game_type"],df["precedence_name"],df["follower_name"])
19
  sfen = df["sfen"].split("\n")
 
27
  else:
28
  te.append(sfen[x])
29
  board = cshogi.Board()
30
+ st.markdown(board.to_svg(),unsafe_allow_html=True)
31
+ s = st.selectbox(options=te)
32
+ idx = te.index(s)
33
+ board = cshogi.Board(sfen=te_sf[s])
34
+ st.markdown(board.to_svg(),unsafe_allow_html=True)
35
+
36
 
37