Skip to content

Commit

Permalink
#4 pororo 라벨링 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
jayleenym committed Jan 6, 2022
1 parent 6954bf4 commit fb2f097
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions Kafka/1228/Naver_Producer1228.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,21 @@
"import datetime\n",
"import pandas as pd\n",
"import datetime\n",
"from tqdm import tqdm"
"from tqdm import tqdm\n",
"\n",
"# 감성사전 처리해서 쌓기\n",
"from pororo import Pororo"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# 여기서 오래 걸릴 수 있음\n",
"s_nm = Pororo(task = 'sentiment',model = 'brainbert.base.ko.nsmc', lang = 'ko')\n",
"s_sh = Pororo(task = 'sentiment', model = 'brainbert.base.ko.shopping', lang = 'ko')"
]
},
{
Expand Down Expand Up @@ -128,26 +142,18 @@
" 'title':title,\n",
" 'views':views,\n",
" 'pos':pos,\n",
" 'neg':neg\n",
" }\n",
" 'neg':neg,\n",
" 'nsmc': s_nm(title, show_probs = True)['positive'],\n",
" 'shop': s_sh(title, show_prob = True)['positivie']\n",
" }\n",
" # print(put_data)\n",
" title_result.append(put_data)\n",
" \n",
" #if TF:\n",
" #break\n",
" return title_result\n",
" #else:\n",
" print(title_result)"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [],
"source": [
"for key,value in ACODE.items():\n",
" result = naver_crawl(value)"
" # print(title_result)"
]
},
{
Expand Down

0 comments on commit fb2f097

Please sign in to comment.