Giter Site home page Giter Site logo

liuhuanyong / importanteventextractor Goto Github PK

View Code? Open in Web Editor NEW
206.0 5.0 54.0 1.33 MB

An exploration for Eventline (important news Rank organized by pulic time),针对某一事件话题下的新闻报道集合,通过使用docrank算法,对新闻报道进行重要性识别,并通过新闻报道时间挑选出时间线上重要新闻。

Python 100.00%

importanteventextractor's Introduction

EventLine

An exploration for Eventline (important news Rank organized by pulic time),针对某一事件话题下的新闻报道集合,通过使用docrank算法,对新闻报道进行重要性识别,并通过新闻报道时间挑选出时间线上重要新闻。

项目介绍

目前,网络上针对某一特定热门事件会产生大量的报道,这些报道会随着该事件的发展而发生内容上的变化,这个具体表现在时间轴上对应新闻的差异性。因此,这就产生了关于特定事件报道的三个问题:
1、同质的新闻报道有很多,如何对浩如烟海的新闻报道进行代表性新闻抽取
2、如何检测这种内容上的变化,如何表示这种内容,这个涉及到内容的表示问题
3、如何对这种变化的内容进行有效组织和表示
本项目将对这三个问题进行尝试探索

项目构成

1、输入:关于一个特定事件的文本集合,关于文本集合的采集,可以参照https://github.com/liuhuanyong/EventMonitor 中特定事件文本语料库的构建
2、中间模型:融合文章用词特征的DOC-RANK文本重要性排序模型
3、输出:1)important_doc:根据重要性值大小排序的新闻报道结果。
2)timelines:以新闻报道发布时间为时间轴的关键新闻报道集合
其中关于输出:
1)important_doc:从相关性的角度解决了第一个问题
2)timelines:提供了问题3的一个基本解决方法(还相对较low)

实验

1、输入:以'中兴事件'为例,共采集到562篇新闻,举例如下:

'''
2018-05-11 08:50@联发科:目前没有发布不能向中兴出售芯片的相关声明.txt   
2018-04-28 07:57:47@中兴通信发布一季报:如无制裁成绩本应如此亮眼.txt   
2018-05-24 08:08:37@高管调整、巨额罚款,中兴解决方案代价不菲.txt   
2018-04-18 09:02:01@受伤害的不止中兴,还有美国芯片厂!直刺**集成电路的脆弱内“芯”.txt   
2018-05-26 08:08:16@中兴小鲜4手机(金属机身香槟金指纹)京东556元(赠品).txt   
2018-05-14 10:41@中兴事件戏剧性转折这三个信号意味深长.txt   
'''

2、中间模型:

算法步骤:
1)新闻报道文本分词,去除停用词,并统计文本词频,设定文本最频繁词频阈值。  
2)基于共词算法,计算新闻报道之间的相关性。相关性的方法如下: 
'''计算文章之间的相关性'''
def calculate_weight(self, word_dict1, word_dict2):
    score = 0
    interwords = set(list(word_dict1.keys())).intersection(set(list(word_dict2.keys())))
    for word in interwords:
        score += round(math.tanh(word_dict1.get(word)/word_dict2.get(word)))
    return score
3)将2)得到的结果,结合textrank算法,以新闻报道为一个graph中的一个节点,通过迭代至收敛,最终得到一个稳定的节点权重。  
4)对3)得到的结果,按照权重值(对应新闻报道的重要性)由大到小排序,输出至important_doc.txt中  
5)对3)得到的结果,通过对同一日期下的新闻报道重要性进行排序,输出至timelines.txt中  

3、输出important_doc举例

以下是对562篇中兴事件新闻报道中重要性值TOP10

    '''
        2018-04-29 09:47:00@中兴一石激千浪**公司担忧的还有另一个“定时炸弹”.txt 1.0  
        2018-04-21 12:32@10分钟的新闻发布会,中兴透露出一件大事情.txt 0.9930902016486721  
        2018-04-23 15:38:30@青年力:由中兴开始的2018中美芯片战.txt 0.9866428387088916  
        2018-04-18 10:43:54@中兴遭美国制裁,芯片这道门槛必须要跨过去.txt 0.844683540929596  
        2018-04-18 @探究中兴遭禁售令究竟该如何“拆招”?.txt 0.8196911028266617  
        2018-04-18 07:41:53@数十类别受波及,中兴遭禁售令.txt 0.8177922162226666  
        2018-04-19 09:09@中兴渡劫:灭顶之灾与吃力不讨好的芯片行业.txt 0.8133495070021921  
        2018-04-17 10:09@一文读懂中兴遭遇“禁售令”:**联发科也被卷入.txt 0.7833879219280031  
        2018-04-17 21:43:54@中兴被禁,华为、海康告急!中美贸易战直刺**“缺芯”软肋.txt 0.7696595419937585  
        2018-04-18 23:38:27@中兴被禁后的“自救与他救”.txt 0.7531341115076232  
    '''       

4、输出的timeline举例

从标题上来看,中兴事件共经历制裁->转机->解除反思三个阶段,具体如下:

....................................中兴遭到美国制裁....................

    '''
    20160406 2016-04-06 12:44:20@中兴换帅风波背后,美国:怪我咯.txt 0.5503254129214843  
    20180417 2018-04-17 10:09@一文读懂中兴遭遇“禁售令”:**联发科也被卷入.txt 0.7833879219280031  
    20180418 2018-04-18 10:43:54@中兴遭美国制裁,芯片这道门槛必须要跨过去.txt 0.844683540929596  
    20180419 2018-04-19 09:09@中兴渡劫:灭顶之灾与吃力不讨好的芯片行业.txt 0.8133495070021921  
    20180420 2018-04-20 15:28@中兴被制裁:前欧美市场员工的一些理解和认识.txt 0.6831555731401355 
    '''

.................................中兴遭到美国制裁事件出现转机............

    '''
    20180514 2018-05-14 07:54@中美大国利益博弈:中兴被美制裁或现重大转机!.txt 0.6903169641746736  
    20180515 2018-05-15 09:52:30@中兴事件迎戏剧性转折特朗普放过中兴的背后有什么条件.txt 0.6593342519411062  
    20180516 2018-05-16 18:20@凤凰涅中兴中长期价值将被重估.txt 0.7504873311728248  
    20180517 2018-05-17 17:30@再谈:中兴事件的受益方和受害者们.txt 0.6626479492925067  
    20180518 2018-05-18 15:16:17@中兴事件或遇转机,专家提示:"缺芯"问题仍需警惕!.txt 0.6293746010076395 
    '''

.....................................中兴事件解决的讨论与反思..........

    '''
    20180524 2018-05-24 18:26@禁令解除脉络日渐清晰中兴回归或有所期.txt 0.6831951907962789  
    20180525 2018-05-25 14:57@要如何才能真正“拯救”中兴?.txt 0.65721685858832  
    20180526 2018-05-26 19:47:02@【金焱看美国】中兴和解,特朗普围堵**的胜算和败算.txt 0.6926229637369306  
    20180528 2018-05-28 16:45@中美贸易战“停火”,但中兴真的可以涅槃重生吗?.txt 0.5194249388979124 
    '''

总结及下一步的工作:

1、本项目中的文本重要性算法只是一个角度,关于重要性的评估还可以有其他方法。
2、从输出的timeline来看,能粗略地看到一个结果,但如何能够真正快速的发现,实际上还有的做。
3、重点解决项目所述的第二个问题

If any question about the project or me ,see https://liuhuanyong.github.io/

importanteventextractor's People

Contributors

liuhuanyong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.