Options

Not getting the total occurences in the word list

ArnoGArnoG Member Posts: 22 Contributor II
edited November 2018 in Help
I created a model that should give me the # of occurances of a word or n-gram. The model should only give the occurances of the words and n-grams that maches a wordlist.
When I ran the model and I check the output of the model  I can see that the n-gram "not-clean" occurs 4 times. But when I check the wordlist of the output it gives only 1 occurrence.

This is because the model is not counting the # of occurances of the excel sheet but the # of occurances of the textfile

How can I change the model that is gives me the # occurances of he words and n-grams of the data in the excelfile?


Model:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.0.003">
  <context>
    <input/>
    <output/>
    <macros/>
  </context>
  <operator activated="true" class="process" compatibility="6.0.002" expanded="true" name="Process">
    <process expanded="true">
      <operator activated="true" class="text:process_document_from_file" compatibility="5.3.002" expanded="true" height="76" name="Process Documents from Files" width="90" x="45" y="165">
        <list key="text_directories">
          <parameter key="Most mentioned negative" value="C:\Improve Your Business\Qing\Rapidminer\Adjective lists\English\Hotels\most_mentioned_neg"/>
        </list>
        <parameter key="use_file_extension_as_type" value="false"/>
        <parameter key="vector_creation" value="Term Occurrences"/>
        <parameter key="add_meta_information" value="false"/>
        <parameter key="keep_text" value="true"/>
        <process expanded="true">
          <operator activated="true" class="text:tokenize" compatibility="5.3.002" expanded="true" height="60" name="Tokenize (4)" width="90" x="112" y="30">
            <parameter key="mode" value="specify characters"/>
            <parameter key="characters" value="."/>
          </operator>
          <operator activated="false" class="text:generate_n_grams_terms" compatibility="5.3.002" expanded="true" height="60" name="Generate n-Grams (2)" width="90" x="313" y="120"/>
          <connect from_port="document" to_op="Tokenize (4)" to_port="document"/>
          <connect from_op="Tokenize (4)" from_port="document" 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="read_excel" compatibility="6.0.003" expanded="true" height="60" name="Read Excel" width="90" x="45" y="30">
        <parameter key="excel_file" value="C:\Improve Your Business\Qing\Rapidminer\English Demo\Hotel Qing Liverpool\Hotel\Hotel Qing Liverpool.xlsx"/>
        <parameter key="sheet_number" value="8"/>
        <parameter key="imported_cell_range" value="A1:A11"/>
        <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="tekst.true.text.attribute"/>
        </list>
      </operator>
      <operator activated="true" class="text:process_document_from_data" compatibility="5.3.002" expanded="true" height="76" name="Process Documents from Data (2)" width="90" x="246" y="165">
        <parameter key="vector_creation" value="Term Occurrences"/>
        <parameter key="keep_text" value="true"/>
        <list key="specify_weights"/>
        <process expanded="true">
          <operator activated="true" class="text:tokenize" compatibility="5.3.002" expanded="true" height="60" name="Tokenize (2)" width="90" x="45" y="30">
            <parameter key="characters" value="."/>
          </operator>
          <operator activated="true" class="text:transform_cases" compatibility="5.3.002" expanded="true" height="60" name="Transform Cases (2)" width="90" x="179" y="30"/>
          <operator activated="true" class="text:generate_n_grams_terms" compatibility="5.3.002" expanded="true" height="60" name="Generate n-Grams (Terms)" width="90" x="380" y="30"/>
          <connect from_port="document" to_op="Tokenize (2)" to_port="document"/>
          <connect from_op="Tokenize (2)" from_port="document" to_op="Transform Cases (2)" to_port="document"/>
          <connect from_op="Transform Cases (2)" from_port="document" to_op="Generate n-Grams (Terms)" to_port="document"/>
          <connect from_op="Generate n-Grams (Terms)" from_port="document" 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="false" class="select_attributes" compatibility="6.0.003" expanded="true" height="76" name="Select Attributes (2)" width="90" x="313" y="345">
        <parameter key="attribute_filter_type" value="no_missing_values"/>
        <parameter key="attributes" value="Sentiment|id|Negative|Positive|text"/>
      </operator>
      <operator activated="false" class="filter_examples" compatibility="6.0.003" expanded="true" height="94" name="Filter Examples" width="90" x="514" y="345">
        <parameter key="condition_class" value="no_missing_attributes"/>
        <list key="filters_list"/>
      </operator>
      <operator activated="false" class="generate_aggregation" compatibility="6.0.003" expanded="true" height="76" name="Generate Aggregation" width="90" x="648" y="345">
        <parameter key="attribute_name" value="Positive"/>
        <parameter key="aggregation_function" value="product"/>
      </operator>
      <connect from_op="Process Documents from Files" from_port="word list" to_op="Process Documents from Data (2)" to_port="word list"/>
      <connect from_op="Read Excel" from_port="output" to_op="Process Documents from Data (2)" to_port="example set"/>
      <connect from_op="Process Documents from Data (2)" from_port="example set" to_port="result 1"/>
      <connect from_op="Process Documents from Data (2)" from_port="word list" 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>

Sign In or Register to comment.