jeanpoll commited on
Commit
3c51821
·
1 Parent(s): 5b85b61

debugging errors next 2

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -9,8 +9,9 @@ def print_highlighted_text(text, df_result, offset=0):
9
  list_values = []
10
  for match in iter_match:
11
  word = match.string[start_pos:match.start()]
12
-
13
  df_entity = df_result.query(f"{start_pos + offset}>=start & {match.start() + offset}<=end").head(1)
 
14
  if len(df_entity) == 1:
15
  entity = df_entity["entity"].values[0]
16
  else:
@@ -62,8 +63,10 @@ iface = gradio.Interface(title="Parser of email",
62
  description="Small application that can extract a specific email in a thread of email,"
63
  " highlights the entities found in the text (person, organization, date,...)"
64
  " and extract email signature if any.",
65
- article="The model used to detect signature is described in detail in this article"
66
- "<a href=\"https://medium.com/@jean-baptiste.polle/lstm-model-for-email-signature-detection-8e990384fefa\">",
 
 
67
  fn=display_email,
68
  inputs=["textbox",
69
  gradio.inputs.Number(default=1, label="Email number in thread")],
 
9
  list_values = []
10
  for match in iter_match:
11
  word = match.string[start_pos:match.start()]
12
+ logging.debug(f"word '{word}' was found between {start_pos} and {match.start()}")
13
  df_entity = df_result.query(f"{start_pos + offset}>=start & {match.start() + offset}<=end").head(1)
14
+ logging.debug(f"Found entites are: {df_entity}")
15
  if len(df_entity) == 1:
16
  entity = df_entity["entity"].values[0]
17
  else:
 
63
  description="Small application that can extract a specific email in a thread of email,"
64
  " highlights the entities found in the text (person, organization, date,...)"
65
  " and extract email signature if any.",
66
+ article="*The model used to detect signature is described in detail here: "
67
+ "<a href=\"https://medium.com/@jean-baptiste.polle/lstm-model-for-email-signature-detection-8e990384fefa\">"
68
+ "https://medium.com/@jean-baptiste.polle/lstm-model-for-email-signature-detection-8e990384fefa"
69
+ "</a>",
70
  fn=display_email,
71
  inputs=["textbox",
72
  gradio.inputs.Number(default=1, label="Email number in thread")],