2014-03-07 71 views
0

我正在使用快速礦工對特定電影的評論進行分析。我使用「getpages」從IMDB中提取評論。網站上列出了大約94條評論,但在提取後我只得到21條評論。該xml代碼是:使用rapidminer進行imdb電影評論的文本分析

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<process version="5.3.015"> 
    <context> 
    <input/> 
    <output/> 
    <macros/> 
    </context> 
    <operator activated="true" class="process" compatibility="5.3.015" expanded="true" name="Process"> 
    <process expanded="true"> 
     <operator activated="true" class="read_excel" compatibility="5.3.015" expanded="true" height="60" name="Read Excel" width="90" x="45" y="30"> 
     <parameter key="excel_file" value="C:\Users\Arbind\Desktop\review\rev.xlsx"/> 
     <parameter key="imported_cell_range" value="A1:A5"/> 
     <parameter key="first_row_as_names" value="false"/> 
     <list key="annotations"> 
      <parameter key="0" value="Name"/> 
     </list> 
     <list key="data_set_meta_data_information"> 
      <parameter key="0" value="Link.true.text.attribute"/> 
     </list> 
     </operator> 
     <operator activated="true" class="web:retrieve_webpages" compatibility="5.3.001" expanded="true" height="60" name="Get Pages" width="90" x="179" y="30"> 
     <parameter key="link_attribute" value="Link"/> 
     </operator> 
     <operator activated="true" class="select_attributes" compatibility="5.3.015" expanded="true" height="76" name="Select Attributes" width="90" x="313" y="30"> 
     <parameter key="attribute_filter_type" value="single"/> 
     <parameter key="attribute" value="gensym1"/> 
     </operator> 
     <operator activated="true" class="text:process_document_from_data" compatibility="5.3.002" expanded="true" height="76" name="Process Documents from Data" width="90" x="447" y="30"> 
     <parameter key="prune_method" value="percentual"/> 
     <parameter key="prune_above_percent" value="90.0"/> 
     <list key="specify_weights"/> 
     <process expanded="true"> 
      <operator activated="true" class="text:cut_document" compatibility="5.3.002" expanded="true" height="60" name="Cut Document" width="90" x="112" y="30"> 
      <parameter key="query_type" value="Regular Region"/> 
      <list key="string_machting_queries"/> 
      <list key="regular_expression_queries"/> 
      <list key="regular_region_queries"> 
       <parameter key="extract" value="&lt;hr[^&gt;]\.*align=&quot;center&quot;&gt;.&lt;hr[^&gt;]\.*align=&quot;center&quot;&gt;"/> 
      </list> 
      <list key="xpath_queries"/> 
      <list key="namespaces"/> 
      <list key="index_queries"/> 
      <process expanded="true"> 
       <operator activated="true" class="text:extract_information" compatibility="5.3.002" expanded="true" height="60" name="Extract Information" width="90" x="112" y="30"> 
       <parameter key="query_type" value="XPath"/> 
       <list key="string_machting_queries"/> 
       <list key="regular_expression_queries"/> 
       <list key="regular_region_queries"/> 
       <list key="xpath_queries"> 
        <parameter key="review" value="//h:p/text()"/> 
        <parameter key="rating" value="//h:img/@alt"/> 
       </list> 
       <list key="namespaces"/> 
       <list key="index_queries"/> 
       </operator> 
       <connect from_port="segment" to_op="Extract Information" to_port="document"/> 
       <connect from_op="Extract Information" from_port="document" to_port="document 1"/> 
       <portSpacing port="source_segment" spacing="0"/> 
       <portSpacing port="sink_document 1" spacing="0"/> 
       <portSpacing port="sink_document 2" spacing="0"/> 
      </process> 
      </operator> 
      <connect from_port="document" to_op="Cut Document" to_port="document"/> 
      <connect from_op="Cut Document" from_port="documents" to_port="document 1"/> 
      <portSpacing port="source_document" spacing="0"/> 
      <portSpacing port="sink_document 1" spacing="0"/> 
      <portSpacing port="sink_document 2" spacing="0"/> 
     </process> 
     </operator> 
     <operator activated="true" class="write_excel" compatibility="5.3.015" expanded="true" height="76" name="Write Excel" width="90" x="514" y="210"> 
     <parameter key="excel_file" value="C:\Users\Arbind\Desktop\review\imdb rev2.xlsx"/> 
     </operator> 
     <connect from_op="Read Excel" from_port="output" to_op="Get Pages" to_port="Example Set"/> 
     <connect from_op="Get Pages" from_port="Example Set" to_op="Select Attributes" to_port="example set input"/> 
     <connect from_op="Select Attributes" from_port="example set output" to_op="Process Documents from Data" to_port="example set"/> 
     <connect from_op="Process Documents from Data" from_port="example set" to_op="Write Excel" to_port="input"/> 
     <connect from_op="Process Documents from Data" from_port="word list" to_port="result 1"/> 
     <connect from_op="Write Excel" from_port="through" to_port="result 2"/> 
     <portSpacing port="source_input 1" spacing="0"/> 
     <portSpacing port="sink_result 1" spacing="0"/> 
     <portSpacing port="sink_result 2" spacing="0"/> 
     <portSpacing port="sink_result 3" spacing="0"/> 
    </process> 
    </operator> 
</process> 

在excel文件中,我一個接一個地看了評論鏈接。 另外我需要用戶給出的「評級」。

+0

也許rapidminer *用戶論壇*是一個比*編程*社區更好的關於快速使用問題的社區。 –

+0

謝謝Anony ......但是你能否提一些很好的論壇來處理? – user3393196

+0

*官方* rapidminer論壇如何? http://forum.rapid-i.com/ –

回答

0

常規區域設置是查找其他評論。這是因爲區域開始的正則表達式與末尾的正則表達式相同。一旦發現結束,直到下一次審查結束纔會發現開始。

+0

但我想知道分析的一部分....如果你能給出總結的想法,應該是完美的程序來挖掘評論...我有點困惑......! ! :-) – user3393196

+0

這是一個新問題。你可能會開始一個新的主題,也許會投票給出迄今爲止給出的答案,以鼓勵人們提供反饋。 – awchisholm

+0

請您將您的編輯修改爲回覆,以便他人可以更容易地看到其他人受益。 – awchisholm

0

imported cell range是電子表格導入中的A1:A5。這意味着有一個隱含的for循環來獲取這5個URL。這反過來導致Get Pages可能跟隨重定向導致更多可能的提取。在不知道URL的情況下無法知道。

你能發表一個電子表格的片段嗎?

+0

是的...我認爲概率是存在的..「A1:A5」....但我再次嘗試將它改爲「A1:A11」...現在獲得47條評論..仍然有一些剩餘.. ! :-) – user3393196