Spaces:
Running
Running
taka-yamakoshi
commited on
Commit
·
ef497bf
1
Parent(s):
6da8b4f
adjust sent id
Browse files
app.py
CHANGED
@@ -52,11 +52,11 @@ if __name__=='__main__':
|
|
52 |
for sent_id, sent_col in enumerate(sent_cols):
|
53 |
with sent_col:
|
54 |
sentence = st.text_input(f'Sentence {sent_id+1}')
|
55 |
-
sents[f'sent_{sent_id}'] = sentence
|
56 |
if len(sentence)>0:
|
57 |
input_sent = tokenizer(sentence)['input_ids']
|
58 |
decoded_sent = [tokenizer.decode([token]) for token in input_sent[1:-1]]
|
59 |
-
num_tokens[f'sent_{sent_id}'] = len(decoded_sent)
|
60 |
|
61 |
#char_nums = [len(word)+2 for word in decoded_sent]
|
62 |
#word_cols = st.columns(char_nums)
|
|
|
52 |
for sent_id, sent_col in enumerate(sent_cols):
|
53 |
with sent_col:
|
54 |
sentence = st.text_input(f'Sentence {sent_id+1}')
|
55 |
+
sents[f'sent_{sent_id+1}'] = sentence
|
56 |
if len(sentence)>0:
|
57 |
input_sent = tokenizer(sentence)['input_ids']
|
58 |
decoded_sent = [tokenizer.decode([token]) for token in input_sent[1:-1]]
|
59 |
+
num_tokens[f'sent_{sent_id+1}'] = len(decoded_sent)
|
60 |
|
61 |
#char_nums = [len(word)+2 for word in decoded_sent]
|
62 |
#word_cols = st.columns(char_nums)
|