UNPKG

bigml-nodered

Version:

BigML bindings for Nodered

397 lines (357 loc) 16.2 kB
<style> .bigml_node_label { fill: white; } #palette-BigML .palette_node { color: white; } #red-ui-palette-BigML .red-ui-palette-label { color: white; } </style> <script type="text/javascript"> RED.nodes.registerType('topic-model', { category: 'BigML', color: '#454957', defaults: {"range":{"value":0},"bigrams":{"value":false},"token_mode":{"value":null},"top_n_terms":{"value":10},"replacement":{"value":false},"n_grams":{"value":1},"tags":{"value":""},"stopword_diligence":{"value":"normal"},"name":{"value":"topicmodel","required":true},"stem_words":{"value":true},"term_filters":{"value":""},"reify":{"value":false},"term_limit":{"value":4096},"seed":{"value":""},"excluded_fields":{"value":""},"case_sensitive":{"value":false},"number_of_topics":{"value":1},"fields":{"value":""},"term_regexps":{"value":""},"category":{"value":0},"language":{"value":"en"},"stopword_removal":{"value":"selected_language"},"webhook":{"value":""},"topicmodel_seed":{"value":""},"out_of_bag":{"value":false},"description":{"value":""},"sample_rate":{"value":1.0},"excluded_terms":{"value":""},"input_fields":{"value":""}}, inputs:1, outputs:1, inputLabels: 'dataset', outputLabels: 'topicmodel', icon: 'icon_topicmodel.png', label: function() { return this.name || 'Topic Model'; }, labelStyle: function() { return this.name?"bigml_node_label":""; }, }); </script> <script type="text/x-red" data-template-name="topic-model"> <div class="form-row"> <label for="node-input-name"> <i class="icon-tag"></i> Name </label> <input type=text id=node-input-name value='topicmodel'> </div> <div class="form-row"> <label for="node-input-description"> <i class="icon-tag"></i> Description </label> <input type=text id=node-input-description > </div> <div class="form-row"> <label for="node-input-bigrams"> <i class="icon-tag"></i> Bigrams </label> <input type=checkbox id=node-input-bigrams value='false'> </div> <div class="form-row"> <label for="node-input-case_sensitive"> <i class="icon-tag"></i> Case sensitive </label> <input type=checkbox id=node-input-case_sensitive value='false'> </div> <div class="form-row"> <label for="node-input-excluded_fields"> <i class="icon-tag"></i> Excluded fields </label> <input type=text id=node-input-excluded_fields placeholder='["000000", "000002"]' > </div> <div class="form-row"> <label for="node-input-excluded_terms"> <i class="icon-tag"></i> Excluded terms </label> <input type=text id=node-input-excluded_terms placeholder='["I", "he", "she", "it", "you", "they", "am", "is", "are", "a", "an", "the"]' > </div> <div class="form-row"> <label for="node-input-fields"> <i class="icon-tag"></i> Fields </label> <input type=text id=node-input-fields placeholder='{ "000000": { "name": "length_1", "label": "Length 1", "description": "Length 1 is sepal length"}, "000002": {"name": "length_2"}}' > </div> <div class="form-row"> <label for="node-input-input_fields"> <i class="icon-tag"></i> Input fields </label> <input type=text id=node-input-input_fields placeholder='["000000", "000003"]' > </div> <div class="form-row"> <label for="node-input-language"> <i class="icon-tag"></i> Language </label> <select id=node-input-language value='en'><option value=ar>Ar</option> <option value=ca>Ca</option> <option value=cs>Cs</option> <option value=da>Da</option> <option value=de>De</option> <option value=en>En</option> <option value=es>Es</option> <option value=fa>Fa</option> <option value=fi>Fi</option> <option value=fr>Fr</option> <option value=hu>Hu</option> <option value=it>It</option> <option value=ja>Ja</option> <option value=ko>Ko</option> <option value=nl>Nl</option> <option value=pl>Pl</option> <option value=pt>Pt</option> <option value=ro>Ro</option> <option value=ru>Ru</option> <option value=sv>Sv</option> <option value=tr>Tr</option> <option value=zh>Zh</option> <option value=none>None</option></select> </div> <div class="form-row"> <label for="node-input-n_grams"> <i class="icon-tag"></i> N-Grams </label> <input type=number id=node-input-n_grams value='1'> </div> <div class="form-row"> <label for="node-input-number_of_topics"> <i class="icon-tag"></i> Number of topics </label> <input type=number id=node-input-number_of_topics value='1'> </div> <div class="form-row"> <label for="node-input-out_of_bag"> <i class="icon-tag"></i> Out of bag </label> <input type=checkbox id=node-input-out_of_bag value='false'> </div> <div class="form-row"> <label for="node-input-range"> <i class="icon-tag"></i> Range </label> <input type=number id=node-input-range value='0'> </div> <div class="form-row"> <label for="node-input-replacement"> <i class="icon-tag"></i> Replacement </label> <input type=checkbox id=node-input-replacement value='false'> </div> <div class="form-row"> <label for="node-input-sample_rate"> <i class="icon-tag"></i> Sample rate </label> <input type=number step=any id=node-input-sample_rate value='1.0'> </div> <div class="form-row"> <label for="node-input-seed"> <i class="icon-tag"></i> Seed </label> <input type=text id=node-input-seed > </div> <div class="form-row"> <label for="node-input-stem_words"> <i class="icon-tag"></i> Stem words </label> <input type=checkbox id=node-input-stem_words value='true'> </div> <div class="form-row"> <label for="node-input-stopword_diligence"> <i class="icon-tag"></i> Stopword diligence </label> <select id=node-input-stopword_diligence value='normal'><option value=light>Light</option> <option value=normal>Normal</option> <option value=aggressive>Aggressive</option></select> </div> <div class="form-row"> <label for="node-input-stopword_removal"> <i class="icon-tag"></i> Stopword removal </label> <select id=node-input-stopword_removal value='selected_language'><option value=none>None</option> <option value=selected_language>Selected language</option> <option value=all_languages>All languages</option></select> </div> <div class="form-row"> <label for="node-input-term_filters"> <i class="icon-tag"></i> Term filters </label> <input type=text id=node-input-term_filters placeholder='["html_keywords" "numeric_digits"]' > </div> <div class="form-row"> <label for="node-input-term_limit"> <i class="icon-tag"></i> Term limit </label> <input type=number id=node-input-term_limit value='4096'> </div> <div class="form-row"> <label for="node-input-term_regexps"> <i class="icon-tag"></i> Term Regexps </label> <input type=text id=node-input-term_regexps > </div> <div class="form-row"> <label for="node-input-token_mode"> <i class="icon-tag"></i> Token mode </label> <select id=node-input-token_mode ><option value=tokens_only>Tokens only</option> <option value=full_terms_only>Full terms only</option> <option value=all>All</option></select> </div> <div class="form-row"> <label for="node-input-top_n_terms"> <i class="icon-tag"></i> Top N terms </label> <input type=number id=node-input-top_n_terms value='10'> </div> <div class="form-row"> <label for="node-input-topicmodel_seed"> <i class="icon-tag"></i> Topicmodel seed </label> <input type=text id=node-input-topicmodel_seed placeholder='My Seed' > </div> <div class="form-row"> <label for="node-input-tags"> <i class="icon-tag"></i> Tags </label> <input type=text id=node-input-tags placeholder='["A tag", "Another Tag"]' > </div> <div class="form-row"> <label for="node-input-category"> <i class="icon-tag"></i> Category </label> <select id=node-input-category value='0'><option value=5>5</option> <option value=Healthcare>Healthcare</option></select> </div> <div class="form-row"> <label for="node-input-webhook"> <i class="icon-tag"></i> Webhook </label> <input type=text id=node-input-webhook > </div> <div class="form-row"> <label for="node-input-reify"> <i class="icon-tag"></i> Reify </label> <input type=checkbox id=node-input-reify value='false'> </div> </script> <script type="text/html" data-help-name="topic-model"> <p>Create BigML Topic Model.</p> <h3>Details</h3> <p>This node support all inputs defined in <a href='https://bigml.com/api/topic-models' target=blank>BigML REST API</a>. By default, it expects to receive a <code>dataset</code> input (see below for more details) and it will output the <code>topicmodel</code> field of the created resource. </p> <p>However, you can override default inputs and outputs by defining the node port label so they match the desired input or output as specified below.</p> <p>Only when the node is used with the <code>reify</code> option enabled, it will actually hit BigML and do its work there. This generally means some resources will be created and sent through as node outputs.</p> <p>When the node is used with the <code>reify</code>option disabled, it will generate WhizzML code and send it through to the next node in the flow without hitting BigML. All WhizzML code created by this node (and others) when not in <code>reify</code> mode is accumulated and executed as a single WhizzML script by the first downstream <code>reified</code> node.</p> <h3>Inputs</h3> <dl class="message-properties"> <dt>Name <span class="property-type">:text</span> </dt> <dd>A name for this node.</dd> <dt>Description <span class="property-type">:text</span> </dt> <dd></dd> <dt>Bigrams <span class="property-type">:boolean</span> </dt> <dd>Whether to include a contiguous sequence of two items from a given sequence of text.</dd> <dt>Case sensitive <span class="property-type">:boolean</span> </dt> <dd>Whether the analysis is case-sensitive or not.</dd> <dt>Excluded fields <span class="property-type">:text</span> </dt> <dd>Specifies the fields that won't be included in the dataset.</dd> <dt>Excluded terms <span class="property-type">:json</span> </dt> <dd>Specifies a list of terms to ignore when performing term analysis.</dd> <dt>Fields <span class="property-type">:text</span> </dt> <dd>Updates the names, labels, and descriptions of the fields in the dataset.</dd> <dt>Input fields <span class="property-type">:text</span> </dt> <dd>Specifies the fields to be included in the dataset.</dd> <dt>Language <span class="property-type">:select</span> </dt> <dd>The default language of text fields in a two-letter language code.</dd> <dt>N-Grams <span class="property-type">:number</span> </dt> <dd>A positive integer n that specifies the use of all sequences of consecutive tokens of length n should be considered as terms, in addition to their constituent tokens.</dd> <dt>Number of topics <span class="property-type">:number</span> </dt> <dd>The number of topics that topic model will generate.</dd> <dt>Out of bag <span class="property-type">:boolean</span> </dt> <dd>Setting this parameter to true will return a sequence of the out-of-bag instances instead of the sampled instances.</dd> <dt>Range <span class="property-type">:number</span> </dt> <dd>The range of successive instances to build the model.</dd> <dt>Replacement <span class="property-type">:boolean</span> </dt> <dd>Whether sampling should be performed with or without replacement.</dd> <dt>Sample rate <span class="property-type">:float</span> </dt> <dd>A real number between 0 and 1 specifying the sample rate.</dd> <dt>Seed <span class="property-type">:text</span> </dt> <dd>A string to be hashed to generate deterministic samples.</dd> <dt>Stem words <span class="property-type">:boolean</span> </dt> <dd>Whether lemmatization (stemming) of terms should be done, according to linguistic rules in the provided language.</dd> <dt>Stopword diligence <span class="property-type">:select</span> </dt> <dd>The aggressiveness of stopword removal, where the levels are light, normal or aggressive, in order, where each level is a superset of words in the previous ones.</dd> <dt>Stopword removal <span class="property-type">:select</span> </dt> <dd>A string or keyword specifying the type of stopword removal to perform.</dd> <dt>Term filters <span class="property-type">:json</span> </dt> <dd>Filters that should be applied to the chosen terms. Available options are.</dd> <dt>Term limit <span class="property-type">:number</span> </dt> <dd>The maximum number of terms used for the topic model vocabulary.</dd> <dt>Term Regexps <span class="property-type">:json</span> </dt> <dd>A list of strings specifying regular expressions to be matched against input documents.</dd> <dt>Token mode <span class="property-type">:select</span> </dt> <dd>Whether tokens_only, full_terms_only or all should be tokenized.</dd> <dt>Top N terms <span class="property-type">:number</span> </dt> <dd>The size of the most influential terms recorded.</dd> <dt>Topicmodel seed <span class="property-type">:text</span> </dt> <dd>With a seed, the topic model is deterministic.</dd> <dt>Tags <span class="property-type">:text</span> </dt> <dd>A list of tags to identify the resource.</dd> <dt>Category <span class="property-type">:select</span> </dt> <dd></dd> <dt>Webhook <span class="property-type">:text</span> </dt> <dd>A webhook url and an optional secret phrase.</dd> <dt>Reify <span class="property-type">:boolean</span> </dt> <dd>Execute the WhizzML code generated at this (and upstream) node(s). You need to enable this option if you want to get a result from your flow that you can pass to a non-BigML node.</dd> </dl> <h3>Outputs</h3> <ol class="node-ports"> <dl class="message-properties"> <dt>payload <span class="property-type">string or JSON</span></dt> <dd>the <code>topicmodel</code> of the created BigML entity.</dd> <dt>whizzml <span class="property-type">string</dt> <dd>(only for <code>reified</code> nodes) the generated WhizzML code which is fed into the next node. <dt>wzStack <span class="property-type">object</dt> <dd>(only for <code>reified</code> nodes) private. </dl> </ol> </script>