unijoh commited on
Commit
413b7fa
·
verified ·
1 Parent(s): 1e1d6b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,12 +4,12 @@ import pandas as pd
4
  # Load and parse the CSV file from Hugging Face
5
  def load_data():
6
  url = "https://huggingface.co/datasets/unijoh/RAVNlex/resolve/main/RAVNlex.csv"
7
- df = pd.read_csv(url, delimiter='\t', encoding='iso-8859-10', names=["#ORTO", "#PPOS", "#PHON1", "#PHON2", "#COMM"])
8
  lemmas = {}
9
  current_lemma = None
10
 
11
  for _, row in df.iterrows():
12
- if row['#ORTO'] == '---':
13
  current_lemma = None
14
  elif current_lemma is None:
15
  current_lemma = row['#ORTO'].replace("ORTO:", "")
 
4
  # Load and parse the CSV file from Hugging Face
5
  def load_data():
6
  url = "https://huggingface.co/datasets/unijoh/RAVNlex/resolve/main/RAVNlex.csv"
7
+ df = pd.read_csv(url, delimiter='\t', encoding='iso-8859-10', names=["#ORTO", "#PPOS", "#PHON1", "#PHON2", "#COMM"], dtype=str)
8
  lemmas = {}
9
  current_lemma = None
10
 
11
  for _, row in df.iterrows():
12
+ if pd.isna(row['#ORTO']) or row['#ORTO'] == '---':
13
  current_lemma = None
14
  elif current_lemma is None:
15
  current_lemma = row['#ORTO'].replace("ORTO:", "")