anamargarida commited on
Commit
48c7ceb
·
verified ·
1 Parent(s): 6416a85

Rename app_20.py to app_21.py

Browse files
Files changed (1) hide show
  1. app_20.py → app_21.py +3 -0
app_20.py → app_21.py RENAMED
@@ -134,6 +134,9 @@ def extract_arguments(text, tokenizer, model, beam_search=True):
134
  tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
135
  token_ids = inputs["input_ids"][0]
136
 
 
 
 
137
 
138
  #st.write("Token Positions, IDs, and Corresponding Tokens:")
139
  #for position, (token_id, token) in enumerate(zip(token_ids, tokens)):
 
134
  tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
135
  token_ids = inputs["input_ids"][0]
136
 
137
+ for i, (token, word_id) in enumerate(zip(tokens, word_ids)):
138
+ st.write(f"Token {i}: {token}, Word ID: {word_id}")
139
+
140
 
141
  #st.write("Token Positions, IDs, and Corresponding Tokens:")
142
  #for position, (token_id, token) in enumerate(zip(token_ids, tokens)):