seawolf2357 commited on
Commit
be78b1e
Β·
verified Β·
1 Parent(s): c1c1dea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -7,6 +7,8 @@ import subprocess
7
  from datasets import load_dataset
8
  import pandas as pd
9
  from fuzzywuzzy import process
 
 
10
  # ν˜„μž¬ μž‘μ—… 디렉토리 좜λ ₯
11
  print("Current Working Directory:", os.getcwd())
12
 
@@ -32,6 +34,9 @@ def load_optimized_dataset(data_files):
32
  print(full_data[['사건λͺ…', 'μ‚¬κ±΄λ²ˆν˜Έ', 'νŒμ‹œμ‚¬ν•­']].head()) # 'νŒμ‹œμ‚¬ν•­' ν•„λ“œμ˜ 데이터 μƒ˜ν”Œ 좜λ ₯
33
  logging.debug(f"Columns in dataset: {full_data.columns}")
34
  logging.debug(f"Sample data from 'νŒμ‹œμ‚¬ν•­': {full_data['νŒμ‹œμ‚¬ν•­'].dropna().head()}")
 
 
 
35
 
36
  # 사건λͺ…을 ν‚€λ‘œ ν•˜κ³  μ‚¬κ±΄λ²ˆν˜Έμ™€ 전문을 μ €μž₯ν•˜λŠ” λ”•μ…”λ„ˆλ¦¬ 생성
37
  name_to_number = full_data.groupby('사건λͺ…')['μ‚¬κ±΄λ²ˆν˜Έ'].apply(list).to_dict()
@@ -149,4 +154,4 @@ async def generate_response(message):
149
 
150
  if __name__ == "__main__":
151
  discord_client = MyClient(intents=intents)
152
- discord_client.run(os.getenv('DISCORD_TOKEN'))
 
7
  from datasets import load_dataset
8
  import pandas as pd
9
  from fuzzywuzzy import process
10
+
11
+
12
  # ν˜„μž¬ μž‘μ—… 디렉토리 좜λ ₯
13
  print("Current Working Directory:", os.getcwd())
14
 
 
34
  print(full_data[['사건λͺ…', 'μ‚¬κ±΄λ²ˆν˜Έ', 'νŒμ‹œμ‚¬ν•­']].head()) # 'νŒμ‹œμ‚¬ν•­' ν•„λ“œμ˜ 데이터 μƒ˜ν”Œ 좜λ ₯
35
  logging.debug(f"Columns in dataset: {full_data.columns}")
36
  logging.debug(f"Sample data from 'νŒμ‹œμ‚¬ν•­': {full_data['νŒμ‹œμ‚¬ν•­'].dropna().head()}")
37
+
38
+ # NaN κ°’ 처리
39
+ full_data['νŒμ‹œμ‚¬ν•­'] = full_data['νŒμ‹œμ‚¬ν•­'].fillna('')
40
 
41
  # 사건λͺ…을 ν‚€λ‘œ ν•˜κ³  μ‚¬κ±΄λ²ˆν˜Έμ™€ 전문을 μ €μž₯ν•˜λŠ” λ”•μ…”λ„ˆλ¦¬ 생성
42
  name_to_number = full_data.groupby('사건λͺ…')['μ‚¬κ±΄λ²ˆν˜Έ'].apply(list).to_dict()
 
154
 
155
  if __name__ == "__main__":
156
  discord_client = MyClient(intents=intents)
157
+ discord_client.run(os.getenv('DISCORD_TOKEN'))