固有表現抽出(NER)を動かしてみる4。(windows, python)。
参考にしたサイト
参考にしたというより、そのまま、動かしただけ。
結果
環境
windows10
python3.7
結果
時短のため、データを減らしたりしているので、全然、正しく動いてませんが。。。
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference. 100%|██████████████████████████████████████████████████████████████████████████████████| 80/80 [10:27<00:00, 7.84s/it] Epochs: 1 | Loss: 0.722 | Accuracy: 0.860 | Val_Loss: 0.467 | Accuracy: 0.903 100%|██████████████████████████████████████████████████████████████████████████████████| 80/80 [10:26<00:00, 7.83s/it] Epochs: 2 | Loss: 0.516 | Accuracy: 0.875 | Val_Loss: 0.430 | Accuracy: 0.900 Test Accuracy: 0.873 Bill Gates is the founder of Microsoft ['O', 'O', 'O', 'O', 'O', 'O', 'O']
ちょっと、データを増やした結果
たぶん、上手くいっている。
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference. 100%|██████████████████████████████████████████████████████████████████████████████| 800/800 [1:38:38<00:00, 7.40s/it] Epochs: 1 | Loss: 0.539 | Accuracy: 0.862 | Val_Loss: 0.372 | Accuracy: 0.900 100%|██████████████████████████████████████████████████████████████████████████████| 800/800 [1:37:52<00:00, 7.34s/it] Epochs: 2 | Loss: 0.364 | Accuracy: 0.897 | Val_Loss: 0.337 | Accuracy: 0.910 100%|██████████████████████████████████████████████████████████████████████████████| 800/800 [1:37:49<00:00, 7.34s/it] Epochs: 3 | Loss: 0.307 | Accuracy: 0.912 | Val_Loss: 0.307 | Accuracy: 0.918 Test Accuracy: 0.913 Bill Gates is the founder of Microsoft ['B-per', 'I-per', 'O', 'O', 'O', 'O', 'B-org']
df = df[0:1000] ・・・ EPOCHS = 3
入力データ
text,labels Thousands of demonstrators have marched through London to protest the war in Iraq and demand the withdrawal of British troops from that country .,O O O O O O B-geo O O O O O B-geo O O O O O B-gpe O O O O O "Iranian officials say they expect to get access to sealed sensitive parts of the plant Wednesday , after an IAEA surveillance system begins functioning .",B-gpe O O O O O O O O O O O O O O B-tim O O O B-org O O O O O "Helicopter gunships Saturday pounded militant hideouts in the Orakzai tribal region , where many Taliban militants are believed to have fled to avoid an earlier military offensive in nearby South Waziristan .",O O B-tim O O O O O B-geo O O O O O B-org O O O O O O O O O O O O O O B-geo I-geo O They left after a tense hour-long standoff with riot police .,O O O O O O O O O O O "U.N. relief coordinator Jan Egeland said Sunday , U.S. , Indonesian and Australian military helicopters are ferrying out food and supplies to remote areas of western Aceh province that ground crews can not reach .",B-geo O O B-per I-per O B-tim O B-geo O B-gpe O B-gpe O O O O O O O O O O O O O B-geo O O O O O O O O "Mr. Egeland said the latest figures show 1.8 million people are in need of food assistance - with the need greatest in Indonesia , Sri Lanka , the Maldives and India .",B-per I-per O O O O O O O O O O O O O O O O O O O O B-tim O B-per B-gpe O O B-geo O B-geo O He said last week 's tsunami and the massive underwater earthquake that triggered it has affected millions in Asia and Africa .,O O O O O O O O O O O O O O O O O O B-geo O B-geo O "Some 1,27,000 people are known dead .",O O O O O O O "Aid is being rushed to the region , but the U.N. official stressed that bottlenecks and a lack of infrastructure remain a challenge .",O O O O O O O O O O B-geo O O O O O O O O O O O O O Lebanese politicians are condemning Friday 's bomb blast in a Christian neighborhood of Beirut as an attempt to sow sectarian strife in the formerly war-torn country .,B-gpe O O O B-tim O O O O O O O O B-geo O O O O O O O O O O O O O "In Beirut , a string of officials voiced their anger , while at the United Nations summit in New York , Prime Minister Fouad Siniora said the Lebanese people are resolute in preventing such attempts from destroying their spirit .",O B-geo O O O O O O O O O O O O B-org I-org O O B-geo I-geo O B-per O B-per I-per O O B-gpe O O O O O O O O O O O O "One person was killed and more than 20 others injured in the bomb blast late Friday , which took place on a residential street .",O O O O O O O O O O O O O O O B-tim O O O O O O O O O Lebanon has suffered a series of bombings since the massive explosion in February that killed former Prime Minister Rafik Hariri and 20 other people .,B-geo O O O O O O O O O O O B-tim O O O B-per O B-per I-per O O O O O "Syria is widely accused of involvement in his killing , and Friday 's explosion comes days before U.N. investigator Detlev Mehlis is to return to Damascus to interview several Syrian officials about the assassination .",B-geo O O O O O O O O O O B-tim O O O O O B-geo O B-per I-per O O O O B-geo O O O B-gpe O O O O O The global financial crisis has left Iceland 's economy in shambles .,O O O O O O B-org O O O O O