Commit
9cb8884
Β·
verified Β·
1 Parent(s): ac80e92

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,7 +9,7 @@ import matplotlib.font_manager as fm
9
  import matplotlib.pyplot as plt
10
  import yfinance as yf
11
  import numpy as np
12
- import re # ν•œκΈ€λ§Œ 남기기 μœ„ν•œ μ •κ·œ ν‘œν˜„μ‹μ— μ‚¬μš©
13
 
14
  # 1. λ‚˜λˆ”κ³ λ”• 폰트 μ„€μΉ˜ 및 적용
15
  def install_nanum_font():
@@ -95,8 +95,8 @@ def get_real_news_summary(company, date):
95
  # μ‘λ‹΅μ—μ„œ μš”μ•½ μΆ”μΆœ
96
  summary = response.choices[0].message.content
97
 
98
- # ν•œκΈ€λ§Œ μΆ”μΆœν•˜λŠ” μ •κ·œ ν‘œν˜„μ‹
99
- korean_only_summary = re.sub(r'[^κ°€-힣\s]', '', summary)
100
 
101
  return korean_only_summary
102
  except Exception as e:
 
9
  import matplotlib.pyplot as plt
10
  import yfinance as yf
11
  import numpy as np
12
+ import re # ν•œκΈ€, 숫자, 기호λ₯Ό 남기기 μœ„ν•œ μ •κ·œ ν‘œν˜„μ‹μ— μ‚¬μš©
13
 
14
  # 1. λ‚˜λˆ”κ³ λ”• 폰트 μ„€μΉ˜ 및 적용
15
  def install_nanum_font():
 
95
  # μ‘λ‹΅μ—μ„œ μš”μ•½ μΆ”μΆœ
96
  summary = response.choices[0].message.content
97
 
98
+ # ν•œκΈ€, 숫자, 곡백, 특수 기호만 λ‚¨κΈ°λŠ” μ •κ·œ ν‘œν˜„μ‹
99
+ korean_only_summary = re.sub(r'[^\w\s#.,!%()-]', '', summary)
100
 
101
  return korean_only_summary
102
  except Exception as e: