NLP-垃圾数据的情感处理需要时间 [英] NLP- Sentiment Processing for Junk Data takes time

查看:109
本文介绍了NLP-垃圾数据的情感处理需要时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试查找输入文本的情感.此测试是一个垃圾句子,当我尝试查找情感"时,解析该句子的注释大约需要30秒.对于普通文本,它需要不到一秒钟的时间.如果我需要处理大约数百万个数据,它将增加处理时间.任何解决方案.

I am trying to find the Sentiment for the input text. This test is a junk sentence and when I tried to find the Sentiment the Annotation to parse the sentence is taking around 30 seconds. For normal text it takes less than a second. If i need to process around millions of data it will add up the time to process. Any solution to this.

String text = "Nm n n 4 n n bkj nun4hmnun Onn njnb hm5bn nm55m nbbh n mnrrnut but n rym4n nbn 4nn65 m nun m n nn nun 4nm 5 gm n my b bb b b rtmrt55tmmm5tttn b b bb g bn nn n h r ret n nun bn d. B bbbbbbbbbbr bung NHnhn nn nk, v v v n gain t g 4gnyhimmigration ndn nb NVnb bin uny 7 nbbbbbnn vv bbvb ninn njnj n4 nm n km n n n cb j bun. Nhfnt bn nn. N hm nn nun m bum my b mmmnbjk nn n by nn nun nun n nun nn bn n nhn n nn n n m NH nb4mnm mkn 4 n n n n hm r b rnfngg4d in b nut mmmkmmm5 bbjn n n ij BBM 8u8i by nun n.nn hm n. n4n By 4n4n bunny RN bny hm j mi. Nymmn FBT not mn n n nm g by n n nnm? Rnyb vCard n5 Yu nn n n n n nt .nm mn nt n nb n n n n by y5nnnhyyh h b b nt njj n m f4n re";
Properties props = new Properties();
            props.setProperty("annotators","tokenize, ssplit, pos,parse,sentiment");
            StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
            Annotation annotation = pipeline.process(text);

对于NLP情绪计算,我必须解析数据,我认为这是花费时间的原因.

For the NLP sentiment calulation I have to parse the data and i think thats the reason its taking time.

谢谢

推荐答案

是的,标准PCFG解析器(默认运行而不指定任何其他选项的解析器)会阻塞这种冗长的废话数据.使用 shift-reduce选区解析器,您的运气可能会更好, PCFG几乎准确.

Yes, the standard PCFG parser (the one that is run by default without any other options specified) will choke on this sort of long nonsense data. You might have better luck using the shift-reduce constituency parser, which is substantially faster than the PCFG and nearly as accurate.

这篇关于NLP-垃圾数据的情感处理需要时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆