how to classify using my own guidelines

mkqmkq Member Posts: 9 Contributor II
I wan to classify some posts based on my own guidelines. for example,  I  want some posts with some keywords are classified  some class.

Answers

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,503 RM Data Scientist
    Hi mkq,

    check this process. It is close to what you search for. It counts the occurences of specific words and assigns a score to it. Weights are possible:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="6.5.002">
     <context>
       <input/>
       <output/>
       <macros/>
     </context>
     <operator activated="true" class="process" compatibility="6.5.002" expanded="true" name="Process">
       <process expanded="true">
         <operator activated="true" class="generate_data_user_specification" compatibility="6.4.000" expanded="true" height="60" name="Generate Data by User Specification" width="90" x="45" y="255">
           <list key="attribute_values">
             <parameter key="SomeOtherWord" value="1"/>
             <parameter key="text" value="1"/>
             <parameter key="example" value="3"/>
           </list>
           <list key="set_additional_roles"/>
         </operator>
         <operator activated="false" class="retrieve" compatibility="6.5.002" expanded="true" height="60" name="Retrieve textstuff" width="90" x="112" y="750">
           <parameter key="repository_entry" value="//Local Repository/Fourm/textstuff"/>
         </operator>
         <operator activated="false" class="subprocess" compatibility="6.5.002" expanded="true" height="94" name="Preprocess Dict" width="90" x="246" y="705">
           <process expanded="true">
             <operator activated="true" breakpoints="after" class="nominal_to_text" compatibility="6.5.002" expanded="true" height="76" name="Nominal to Text" width="90" x="112" y="30"/>
             <operator activated="true" class="text:process_document_from_data" compatibility="6.5.000" expanded="true" height="76" name="Process Documents from Data" width="90" x="246" y="30">
               <parameter key="vector_creation" value="Term Occurrences"/>
               <list key="specify_weights"/>
               <process expanded="true">
                 <operator activated="true" class="text:tokenize" compatibility="6.5.000" expanded="true" height="60" name="Tokenize" width="90" x="380" y="30">
                   <parameter key="mode" value="specify characters"/>
                   <parameter key="characters" value="\s"/>
                 </operator>
                 <connect from_port="document" to_op="Tokenize" to_port="document"/>
                 <connect from_op="Tokenize" 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="filter_example_range" compatibility="6.5.002" expanded="true" height="76" name="Filter Example Range" width="90" x="380" y="210">
               <parameter key="first_example" value="1"/>
               <parameter key="last_example" value="1"/>
             </operator>
             <operator activated="true" class="loop_attributes" compatibility="6.5.002" expanded="true" height="76" name="Loop Attributes" width="90" x="514" y="210">
               <process expanded="true">
                 <operator activated="true" class="generate_attributes" compatibility="6.4.000" expanded="true" height="76" name="Generate Attributes (2)" width="90" x="313" y="30">
                   <list key="function_descriptions">
                     <parameter key="%{loop_attribute}" value="1"/>
                   </list>
                 </operator>
                 <connect from_port="example set" to_op="Generate Attributes (2)" to_port="example set input"/>
                 <connect from_op="Generate Attributes (2)" from_port="example set output" to_port="example set"/>
                 <portSpacing port="source_example set" spacing="0"/>
                 <portSpacing port="sink_example set" spacing="0"/>
                 <portSpacing port="sink_result 1" spacing="0"/>
               </process>
             </operator>
             <operator activated="true" class="generate_attributes" compatibility="6.4.000" expanded="true" height="76" name="Generate Attributes (3)" width="90" x="648" y="210">
               <list key="function_descriptions">
                 <parameter key="label" value="1"/>
               </list>
             </operator>
             <operator activated="true" class="set_role" compatibility="6.5.002" expanded="true" height="76" name="Set Role" width="90" x="782" y="30">
               <parameter key="attribute_name" value="label"/>
               <parameter key="target_role" value="label"/>
               <list key="set_additional_roles"/>
             </operator>
             <connect from_port="in 1" to_op="Nominal to Text" to_port="example set input"/>
             <connect from_op="Nominal to Text" 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="Filter Example Range" to_port="example set input"/>
             <connect from_op="Process Documents from Data" from_port="word list" to_port="out 2"/>
             <connect from_op="Filter Example Range" from_port="example set output" to_op="Loop Attributes" to_port="example set"/>
             <connect from_op="Loop Attributes" from_port="example set" to_op="Generate Attributes (3)" to_port="example set input"/>
             <connect from_op="Generate Attributes (3)" from_port="example set output" to_op="Set Role" to_port="example set input"/>
             <connect from_op="Set Role" from_port="example set output" to_port="out 1"/>
             <portSpacing port="source_in 1" spacing="0"/>
             <portSpacing port="source_in 2" spacing="0"/>
             <portSpacing port="sink_out 1" spacing="0"/>
             <portSpacing port="sink_out 2" spacing="0"/>
             <portSpacing port="sink_out 3" spacing="0"/>
           </process>
         </operator>
         <operator activated="true" class="text:create_document" compatibility="6.5.000" expanded="true" height="60" name="Create Document" width="90" x="45" y="30">
           <parameter key="text" value="This is an example text"/>
         </operator>
         <operator activated="true" class="multiply" compatibility="6.5.002" expanded="true" height="94" name="Multiply" width="90" x="179" y="255"/>
         <operator activated="true" class="write_csv" compatibility="6.5.002" expanded="true" height="76" name="Write CSV" width="90" x="313" y="300">
           <parameter key="column_separator" value=" "/>
           <parameter key="quote_nominal_values" value="false"/>
         </operator>
         <operator activated="true" class="text:read_document" compatibility="6.5.000" expanded="true" height="60" name="Read Document" width="90" x="447" y="345"/>
         <operator activated="true" class="generate_attributes" compatibility="6.4.000" expanded="true" height="76" name="Generate Attributes (4)" width="90" x="313" y="210">
           <list key="function_descriptions">
             <parameter key="label" value="1"/>
           </list>
         </operator>
         <operator activated="true" class="set_role" compatibility="6.5.002" expanded="true" height="76" name="Set Role (2)" width="90" x="447" y="210">
           <parameter key="attribute_name" value="label"/>
           <parameter key="target_role" value="label"/>
           <list key="set_additional_roles"/>
         </operator>
         <operator activated="true" class="vector_linear_regression" compatibility="6.5.002" expanded="true" height="76" name="Vector Linear Regression" width="90" x="581" y="210">
           <parameter key="use_bias" value="false"/>
         </operator>
         <operator activated="true" class="text:process_documents" compatibility="6.5.000" expanded="true" height="94" name="Process Documents (2)" width="90" x="581" y="345">
           <parameter key="vector_creation" value="Term Occurrences"/>
           <process expanded="true">
             <operator activated="true" class="text:tokenize" compatibility="6.5.000" expanded="true" height="60" name="Tokenize (3)" width="90" x="246" y="75"/>
             <connect from_port="document" to_op="Tokenize (3)" to_port="document"/>
             <connect from_op="Tokenize (3)" 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="text:process_documents" compatibility="6.5.000" expanded="true" height="94" name="Process Documents" width="90" x="648" y="30">
           <parameter key="vector_creation" value="Term Occurrences"/>
           <process expanded="true">
             <operator activated="true" class="text:tokenize" compatibility="6.5.000" expanded="true" height="60" name="Tokenize (2)" width="90" x="246" y="75"/>
             <connect from_port="document" to_op="Tokenize (2)" to_port="document"/>
             <connect from_op="Tokenize (2)" 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="apply_model" compatibility="6.5.002" expanded="true" height="76" name="Apply Model" width="90" x="849" y="75">
           <list key="application_parameters"/>
         </operator>
         <connect from_op="Generate Data by User Specification" from_port="output" to_op="Multiply" to_port="input"/>
         <connect from_op="Create Document" from_port="output" to_op="Process Documents" to_port="documents 1"/>
         <connect from_op="Multiply" from_port="output 1" to_op="Generate Attributes (4)" to_port="example set input"/>
         <connect from_op="Multiply" from_port="output 2" to_op="Write CSV" to_port="input"/>
         <connect from_op="Write CSV" from_port="file" to_op="Read Document" to_port="file"/>
         <connect from_op="Read Document" from_port="output" to_op="Process Documents (2)" to_port="documents 1"/>
         <connect from_op="Generate Attributes (4)" from_port="example set output" to_op="Set Role (2)" to_port="example set input"/>
         <connect from_op="Set Role (2)" from_port="example set output" to_op="Vector Linear Regression" to_port="training set"/>
         <connect from_op="Vector Linear Regression" from_port="model" to_op="Apply Model" to_port="model"/>
         <connect from_op="Process Documents (2)" from_port="word list" to_op="Process Documents" to_port="word list"/>
         <connect from_op="Process Documents" from_port="example set" to_op="Apply Model" to_port="unlabelled data"/>
         <connect from_op="Apply Model" from_port="labelled data" to_port="result 1"/>
         <portSpacing port="source_input 1" spacing="0"/>
         <portSpacing port="sink_result 1" spacing="0"/>
         <portSpacing port="sink_result 2" spacing="0"/>
       </process>
     </operator>
    </process>
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • mkqmkq Member Posts: 9 Contributor II
    Thank you very much ! You help me a lot!  :D
Sign In or Register to comment.