【问题标题】:text analysis for imdb movie review using rapidminer使用 rapidminer 对 imdb 电影评论进行文本分析
【发布时间】:2014-03-07 15:24:04
【问题描述】:

我正在使用快速挖掘器对特定电影的评论进行分析。我使用“getpages”从 IMDB 中提取评论。网站上列出了大约 94 条评论,但提取后我只得到了 21 条。 xml代码为:

    <?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 文件中,我一个接一个地获取评论的链接。 我还需要用户给出的“评分”。

【问题讨论】:

  • 也许 rapidminer 用户论坛 是一个比 编程 社区更好地询问 rapidminer 使用问题的社区。​​span>
  • 谢谢 Anony...但是你能不能提一些好的论坛来接近???
  • 官方 rapidminer 论坛怎么样? forum.rapid-i.com
  • 非常感谢 Anony..!!!

标签: web-scraping rapidminer imdb text-analysis


【解决方案1】:

常规区域设置是查找所有其他评论。这是因为区域开始的正则表达式与结束的正则表达式相同。一旦找到结束,直到下一次审查结束,才会找到开始。

【讨论】:

  • 但我想知道分析部分....如果你能给出总结的想法,那么在评论中进行挖掘的完美程序应该是什么......我有点困惑……!!! :-)
  • 这是一个新问题。您是否可以开始一个新线程,并为迄今为止给出的答案投票,以鼓励人们提供反馈。
  • 请您将您对 cme​​ts 的编辑更改为回复,以便其他人更容易看到并从中受益。
【解决方案2】:

电子表格导入中的imported cell rangeA1:A5。这意味着有一个隐含的 for 循环来获取这 5 个 URL。这反过来会导致Get Pages,它可能会跟随重定向导致更多可能的获取。不知道网址是不可能知道的。

您可以发布电子表格的 sn-p 吗?

【讨论】:

  • 是的......我认为问题在那里......“A1:A5”......但我再次尝试将其更改为“A1:A11”......现在得到47条评论。 .还有一些..!!! :-)
猜你喜欢
  • 2019-06-25
  • 1970-01-01
  • 2013-01-08
  • 2019-10-09
  • 2015-07-03
  • 2022-08-14
  • 2011-04-12
  • 2014-02-02
  • 2021-09-15
相关资源
最近更新 更多