<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SAS Code to write conditions for user defined topics in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-Code-to-write-conditions-for-user-defined-topics/m-p/289688#M4335</link>
    <description>&lt;P&gt;Also I am not quite clear about how the connection between SAS Code node and TT node exists. If&amp;nbsp;SAS code node comes after TT node, then how can I again see the documents falling under each topic&amp;nbsp;just like how I am able to see in TT node? Should I connect one more TT node again after SAS Code node to view&amp;nbsp;the documents related&amp;nbsp;to each topic or what should I do in this case?&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2016 00:19:46 GMT</pubDate>
    <dc:creator>mganesh10</dc:creator>
    <dc:date>2016-08-05T00:19:46Z</dc:date>
    <item>
      <title>SAS Code to write conditions for user defined topics</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-Code-to-write-conditions-for-user-defined-topics/m-p/289605#M4324</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've a SAS Text Topic node that has a list of user defined topics. I have a set of documents adhering to the user defined topics in my result set from the TT node. I've glanced the data and apparently I found that I need to write a condition that uses Negation (~) operator for obtaining even more accurate results. To add more clarity to this, I am giving you this example. I've a topic called &lt;STRONG&gt;TOPIC_SODA&lt;/STRONG&gt; and the term that identifies that topic is &lt;STRONG&gt;SODA&lt;/STRONG&gt;.&amp;nbsp;I've got the result set that has the term SODA in it. In the result set I found that there are set of documents that has &lt;STRONG&gt;SODA&lt;/STRONG&gt; combined with one more term called &lt;STRONG&gt;SCOTCH&lt;/STRONG&gt; and I don't want that document to appear under my topic(&lt;STRONG&gt;TOPIC_SODA&lt;/STRONG&gt;) in the result set. So I decided to use my condition in the term classification as SODA &amp;amp; ~SCOTCH. Unfortunately I was not able to use this type of condition in the TT user topic declaration.&amp;nbsp;Is there any node that I can use to feed user defined topic which is based on a condition to the Text Topic node? I need the exact result to form my custom topic using the condition that I've given above and use that in the Text Topic node to filter the documents. I've added the snippets that shows my result set and failed approach.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12833i0DDFC980B12F0D3A/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="1.PNG" title="1.PNG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12834iCC74AE03C2FDD69C/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Failed Topic.PNG" title="Failed Topic.PNG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12835i92A468A54B055098/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SCOTCH and SODA output.PNG" title="SCOTCH and SODA output.PNG" /&gt;</description>
      <pubDate>Thu, 04 Aug 2016 18:03:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-Code-to-write-conditions-for-user-defined-topics/m-p/289605#M4324</guid>
      <dc:creator>mganesh10</dc:creator>
      <dc:date>2016-08-04T18:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code to write conditions for user defined topics</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-Code-to-write-conditions-for-user-defined-topics/m-p/289657#M4333</link>
      <description>&lt;P&gt;Since you have already created your topics, you could&amp;nbsp;create one more&amp;nbsp;called &amp;nbsp;TOPIC_SCOTCH. Then connect a SAS code node to your TT node and use the transformation language to create a new topic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data &amp;amp;em_export_train;
	set &amp;amp;em_import_data;
	if textTopic_1 and not textTopic_2 then Soda = 1; 
run; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now run the node and you will be able to filter your data by Soda.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here the code assumes that TOPIC_SODA is a label for textTopic_1 and TOPIC_SCOTCH is a label for textTopic_2. To see the actual correspondence between labels and variable names, you can select the TT node, choose Exported Data, then Properties. Click on the Variables tab and select Label. This will show you the names of the topic variables that you should use in your Data Step code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Tip-Transform-Unstructured-Text-Data-into-Inputs-for-Predictive/ta-p/221774" target="_self"&gt; tip&lt;/A&gt; may provide some perspective. (Regular expressions are another possibility.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Ray&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 20:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-Code-to-write-conditions-for-user-defined-topics/m-p/289657#M4333</guid>
      <dc:creator>rayIII</dc:creator>
      <dc:date>2016-08-04T20:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code to write conditions for user defined topics</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-Code-to-write-conditions-for-user-defined-topics/m-p/289684#M4334</link>
      <description>&lt;P&gt;Okay. In this case all the documents that has the keyword scotch will be removed. I need to filter out&amp;nbsp;only those documents that has both scotch and soda appearing together in it.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2016 23:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-Code-to-write-conditions-for-user-defined-topics/m-p/289684#M4334</guid>
      <dc:creator>mganesh10</dc:creator>
      <dc:date>2016-08-04T23:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code to write conditions for user defined topics</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-Code-to-write-conditions-for-user-defined-topics/m-p/289688#M4335</link>
      <description>&lt;P&gt;Also I am not quite clear about how the connection between SAS Code node and TT node exists. If&amp;nbsp;SAS code node comes after TT node, then how can I again see the documents falling under each topic&amp;nbsp;just like how I am able to see in TT node? Should I connect one more TT node again after SAS Code node to view&amp;nbsp;the documents related&amp;nbsp;to each topic or what should I do in this case?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 00:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-Code-to-write-conditions-for-user-defined-topics/m-p/289688#M4335</guid>
      <dc:creator>mganesh10</dc:creator>
      <dc:date>2016-08-05T00:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Code to write conditions for user defined topics</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/SAS-Code-to-write-conditions-for-user-defined-topics/m-p/289690#M4336</link>
      <description>&lt;P&gt;Once you have the SAS code mode running successfully, examine the data exported from that node. It will have the document*topics matrix along with any new topics you created in the SAS code node.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can hook up additional nodes to the SAS code node to plot the topics, save the exported data, build predictive models, and so on. But no more TT nodes should be needed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ray&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2016 00:59:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/SAS-Code-to-write-conditions-for-user-defined-topics/m-p/289690#M4336</guid>
      <dc:creator>rayIII</dc:creator>
      <dc:date>2016-08-05T00:59:12Z</dc:date>
    </item>
  </channel>
</rss>

