<snapdata remixID="11284309"><project name="Hugging Face models" app="Snap! 7, https://snap.berkeley.edu" version="2"><notes>This project provides access to over 15,000 neural network models provided by Hugging Face. An API key from huggingface.co (not .com) is required. A free plan provides 30,000 input characters per month.&#xD;&#xD;Examples include:&#xD;* Translate between languages. &#xD;* Classify text into categories you choose.&#xD;* Produce a summary of text. &#xD;* Hold a conversation. &#xD;* Query a spreadsheet.&#xD;* Answer a question given a context. &#xD;* Detect how positive or negative some is.&#xD;* Find the named entities in some text.&#xD;* Fill in the blanks. </notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAAAXNSR0IArs4c6QAAArNJREFUeF7t1zFqKlEAhtEbTe8CXJO1YBFtXEd2lE24G+1FBZmH6VIkxSv8QM5UFgM/893DDL5N0zQNlwJRgTcAo/JmvwsACEJaAMA0v3EAGUgLAJjmNw4gA2kBANP8xgFkIC0AYJrfOIAMpAUATPMbB5CBtACAaX7jADKQFgAwzW8cQAbSAgCm+Y0DyEBaAMA0v3EAGUgLAJjmNw4gA2kBANP8xgFkIC0AYJrfOIAMpAUATPMbB5CBtACAaX7jADKQFgAwzW8cQAbSAgCm+Y0DyEBaAMA0v3EAGUgLAJjmNw4gA2kBANP8xgFkIC0AYJrfOIAMpAUATPMbB5CBtACAaX7jADKQFgAwzW8cQAbSAgCm+Y0DyEBaAMA0v3EAGUgLAJjmNw4gA2kBANP8xgFkIC0A4C/5v76+xvF4HKvVaiyXy/SQXnkcwF9O93K5jO12O2632zfEx+/7/T72+/14f39/ZRNPfTYA/8h9OBzG5+fnWCwWP+46n89jt9uNaZrGZrN56oG92hiA/wHw8Xb8+PgYs9lsrNfrVzPx1OcB8I9P8OMtd71ex+l0+vEJns/nTz2kVx4D0J+Q1DeAaX7jADKQFgAwzW8cQAbSAgCm+Y0DyEBaAMA0v3EAGUgLAJjmNw4gA2kBANP8xgFkIC0AYJrfOIAMpAUATPMbB5CBtACAaX7jADKQFgAwzW8cQAbSAgCm+Y0DyEBaAMA0v3EAGUgLAJjmNw4gA2kBANP8xgFkIC0AYJrfOIAMpAUATPMbB5CBtACAaX7jADKQFgAwzW8cQAbSAgCm+Y0DyEBaAMA0v3EAGUgLAJjmNw4gA2kBANP8xgFkIC0AYJrfOIAMpAUATPMbB5CBtACAaX7jADKQFgAwzW8cQAbSAgCm+Y0DyEBaAMA0v3EAGUgLAJjmN/4PWyYdtyHgeG4AAAAASUVORK5CYII=</thumbnail><scenes select="1"><scene name="Hugging Face models"><notes>This project provides access to over 15,000 neural network models provided by Hugging Face. An API key from huggingface.co (not .com) is required. A free plan provides 30,000 input characters per month.&#xD;&#xD;Examples include:&#xD;* Translate between languages. &#xD;* Classify text into categories you choose.&#xD;* Produce a summary of text. &#xD;* Hold a conversation. &#xD;* Query a spreadsheet.&#xD;* Answer a question given a context. &#xD;* Detect how positive or negative some is.&#xD;* Find the named entities in some text.&#xD;* Fill in the blanks. </notes><palette><category name="Hugging Face" color="119,0,194,1"/></palette><hidden></hidden><headers></headers><code></code><blocks><block-definition s="key: %&apos;key&apos; value: %&apos;value&apos;" type="reporter" category="operators"><header></header><code></code><translations>pt:um par (chave: _ , valor: _ )&#xD;</translations><inputs><input type="%s"></input><input type="%s"></input></inputs><script><block s="doReport"><block s="reportNewList"><list><block var="key"/><block var="value"/></list></block></block></script></block-definition><block-definition s="%&apos;method&apos; url: %&apos;url&apos; send: %&apos;payload&apos; headers: %&apos;headers&apos;" type="reporter" category="sensing"><header></header><code></code><translations>pt:a resposta a _ de _ enviando _ e cabeçalhos _&#xD;</translations><inputs><input type="%s" readonly="true">GET<options>GET&#xD;POST&#xD;PUT&#xD;DELETE</options></input><input type="%s">https://snap.berkeley.edu</input><input type="%s"></input><input type="%mult%l" readonly="true"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>xhr_request(mth, url, dta, hdrs)</l><list><block var="method"/><block var="url"/><block var="payload"/><block var="headers"/></list></block></block></script></block-definition><block-definition s="Hugging face model %&apos;model name&apos; with key %&apos;api key&apos; $nl with input %&apos;data&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="433.9327566964286" collapsed="false">Can communicate with over 15,000 models.&#xD;The API key can be obtained from huggingface.co&#xD;More information at&#xD;https://ecraft2learn.github.io/ai/AI-Teacher-Guide/chapter-5.html#hugging-face</comment><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%txt"></input><input type="%mult%s"></input></inputs><script><custom-block s="let %upvar be %s"><l>response string</l><custom-block s="%s url: %s send: %s headers: %mult%l"><l>POST</l><block s="reportJoinWords"><list><l>https://api-inference.huggingface.co/models/</l><block var="model name"/></list></block><block s="reportJoinWords"><list><l>{</l><custom-block s="separate with commas %l"><block var="data"/></custom-block><l>}</l></list></block><list><custom-block s="key: %s value: %s"><l>Authorization</l><block s="reportJoinWords"><list><l>Bearer </l><block var="api key"/></list></block></custom-block></list><comment w="201.42857142857144" collapsed="true">Send the request to Hugging Face.</comment></custom-block></custom-block><custom-block s="let %upvar be %s"><l>response</l><block s="reportTextSplit"><block var="response string"/><l><option>json</option></l></block><comment w="241.6710379464288" collapsed="true">Turn the response from JSON to Snap! lists.</comment></custom-block><custom-block s="let %upvar be %s"><l>error</l><custom-block s="lookup value of %txt in %l"><l>error</l><block var="response"/></custom-block></custom-block><block s="doIf"><block s="reportAnd"><block s="reportIsA"><block var="error"/><l><option>list</option></l></block><block s="reportEquals"><block s="reportListAttribute"><l><option>length</option></l><block var="error"/></block><l>1</l></block></block><script><block s="doSetVar"><l>error</l><block s="reportListItem"><l>1</l><block var="error"/></block></block></script></block><block s="doIfElse"><block s="reportIsA"><block var="error"/><l><option>text</option></l><comment w="158.57142857142875" collapsed="true">Check if there is an error</comment></block><script><block s="doIfElse"><custom-block s="text %txt contains %txt"><block var="error"/><l>is currently loading</l><comment w="260.0118582589286" collapsed="true">If the error is that the model isn&apos;t ready then wait.</comment></custom-block><script><block s="doThinkFor"><l>Loading please wait.</l><block s="reportQuotient"><custom-block s="lookup value of %txt in %l"><l>estimated_time</l><block var="response"/></custom-block><l>2</l></block><comment w="204.2975725446423" collapsed="true">Estimates seem too large so try 1/2</comment></block><block s="doReport"><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><block var="model name"/><block var="api key"/><block var="data"/></custom-block></block></script><script><block s="doReport"><block var="error"/></block></script></block></script><script><block s="doReport"><block var="response"/></block></script></block></script></block-definition><block-definition s="lookup value of %&apos;key&apos; in %&apos;association list&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%l"></input></inputs><script><custom-block s="let %upvar be %s"><l>entry</l><block s="reportFindFirst"><block s="reifyPredicate"><autolambda><block s="reportEquals"><block s="reportListItem"><l>1</l><l/></block><block var="key"/></block></autolambda><list></list></block><block var="association list"/></block></custom-block><block s="doIfElse"><block s="reportIsA"><block var="entry"/><l><option>list</option></l></block><script><block s="doReport"><block s="reportListItem"><l>2</l><block var="entry"/></block></block></script><script><block s="doReport"><block s="reportBoolean"><l><bool>false</bool></l></block></block></script></block></script></block-definition><block-definition s="position of %&apos;small&apos; in %&apos;large&apos;" type="reporter" category="operators"><comment x="0" y="0" w="294" collapsed="false">Reports the character position (starting from 1) of the beginning of the first input string inside the second input string.&#xD;If it&apos;s not found, reports 0.</comment><header></header><code></code><translations>pt:a posição de _ em _&#xD;ca:posició de _ en _&#xD;</translations><inputs><input type="%s"></input><input type="%txt"></input></inputs><script><block s="doReport"><block s="reportIfElse"><custom-block s="use case-independent comparison"></custom-block><block s="reportApplyExtension"><l>txt_indexof(sub, txt)</l><list><custom-block s="to lower case %txt"><block var="small"/></custom-block><custom-block s="to lower case %txt"><block var="large"/></custom-block></list></block><block s="reportApplyExtension"><l>txt_indexof(sub, txt)</l><list><block var="small"/><block var="large"/></list></block></block></block></script></block-definition><block-definition s="text %&apos;string&apos; contains %&apos;marker&apos;" type="predicate" category="operators"><comment x="0" y="0" w="218" collapsed="false">Reports True if the first input string contains the second input string, otherwise false.&#xD;&#xD;Comparison is case-independent by default; use USE CASE-INDEPENDENT COMPARISONS to change that.</comment><header></header><code></code><translations>pt:o texto de _ antes de _&#xD;ca:text _ conté _ ?&#xD;</translations><inputs><input type="%txt"></input><input type="%txt"></input></inputs><script><block s="doReport"><block s="reportGreaterThan"><custom-block s="position of %s in %txt"><block var="marker"/><block var="string"/></custom-block><l>0</l></block></block></script></block-definition><block-definition s="to lower case %&apos;text&apos;" type="reporter" category="operators"><comment x="0" y="0" w="275.3333333333333" collapsed="false">Reports the input text with lower case letters instead of capital letters in the input.  Uses the user&apos;s locale&apos;s rules for case conversion.</comment><header></header><code></code><translations>pt:em minúsculas _&#xD;ca:_ a minúscules&#xD;</translations><inputs><input type="%txt"></input></inputs><script><block s="doReport"><block s="reportApplyExtension"><l>txt_lowercase(txt)</l><list><block var="text"/></list></block></block></script></block-definition><block-definition s="use case-independent comparison" type="predicate" category="sensing"><header></header><code></code><translations>ca:comparacions ignorant majúscules?&#xD;</translations><inputs></inputs><script><block s="doDeclareVariables"><list><l>result</l></list></block><block s="doApplyExtension"><l>err_try(cmd, catch, err)</l><list><block s="reifyScript"><script><block s="doSetVar"><l>result</l><block s="reportApplyExtension"><l>var_get(name)</l><list><l>_case indepent</l></list></block></block></script><list></list></block><block s="reifyScript"><script><block s="doSetVar"><l>result</l><block s="reportBoolean"><l><bool>true</bool></l></block></block></script><list></list></block><l></l></list></block><block s="doApplyExtension"><l>err_reset</l><list></list></block><block s="doReport"><block var="result"/></block></script></block-definition><block-definition s="text or texts input %&apos;text or texts&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="220" collapsed="true">Input can either be text or a list of texts.</comment><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doIfElse"><block s="reportIsA"><block var="text or texts"/><l><option>text</option></l></block><script><block s="doReport"><block s="reportJoinWords"><list><l>"inputs": </l><custom-block s="quote %txt"><block var="text or texts"/></custom-block></list></block></block></script><script><block s="doReport"><block s="reportJoinWords"><list><l>"inputs": [</l><custom-block s="separate with commas %l"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="quote %txt"><l></l></custom-block></autolambda><list></list></block><block var="text or texts"/></block></custom-block><l>]</l></list></block></block></script></block></script></block-definition><block-definition s="all but last %&apos;list&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doIfElse"><block s="reportLessThanOrEquals"><block s="reportListAttribute"><l><option>length</option></l><block var="list"/></block><l>1</l></block><script><block s="doReport"><block s="reportNewList"><list></list></block></block></script><script><block s="doReport"><block s="reportListItem"><block s="reportNumbers"><l>1</l><block s="reportDifference"><block s="reportListAttribute"><l><option>length</option></l><block var="list"/></block><l>1</l></block></block><block var="list"/></block></block></script></block></script></block-definition><block-definition s="get API key of Hugging Face and explain %&apos;explain flag&apos; and ask %&apos;ask flag&apos;" type="reporter" category="other"><header></header><code></code><translations></translations><inputs><input type="%b">true</input><input type="%b">true</input></inputs><script><block s="doIf"><block s="reportIsA"><block var="huggingface api key"/><l><option>text</option></l></block><script><block s="doReport"><block var="huggingface api key"/></block></script></block><block s="doIf"><block s="reportIsA"><block s="reportApplyExtension"><l>db_get(key)</l><list><l>Hugging Face</l></list></block><l><option>text</option></l></block><script><block s="doReport"><block s="reportApplyExtension"><l>db_get(key)</l><list><l>Hugging Face</l></list></block></block></script></block><block s="doIf"><block var="explain flag"/><script><custom-block s="let %upvar be %s"><l>message</l><custom-block s="multiline %mlt"><l>You need to have an API key from Hugging Face to run this.&#xD;Your key should be kept secret and not shared. &#xD;We recommend you read the scripts of this project to be sure your keys will be safe. &#xD;You can get a key from huggingface.co (not .com)</l></custom-block></custom-block><block s="doSayFor"><block var="message"/><l>10</l></block><block s="doSetVar"><l>message</l><custom-block s="multiline %mlt"><l>We can store your key in the browser&apos;s local storage.&#xD;We recommend this only if you are the only user of this computer.</l></custom-block></block><block s="doSayFor"><block var="message"/><l>6</l></block></script></block><block s="doIf"><block var="ask flag"/><script><block s="doAsk"><l>Enter your key or just press enter if this is a shared computer</l></block><block s="doIfElse"><block s="reportEquals"><block s="reportStringSize"><block s="getLastAnswer"></block></block><l>0</l></block><script><block s="doAsk"><l>OK.Now it is safe to enter your key. It will not be stored.</l></block><block s="doSetVar"><l>huggingface api key</l><block s="getLastAnswer"></block></block></script><script><block s="doApplyExtension"><l>db_store(key, val)</l><list><l>Hugging Face</l><block s="getLastAnswer"></block></list></block></script></block><block s="doReport"><block s="getLastAnswer"></block></block></script></block></script></block-definition><block-definition s="multiline %&apos;text&apos;" type="reporter" category="operators"><header></header><code></code><translations>pt:o texto multilinha _&#xD;ca:multilínia _&#xD;</translations><inputs><input type="%mlt"></input></inputs><script><block s="doReport"><block var="text"/></block></script></block-definition><block-definition s="let %&apos;var&apos; be %&apos;value&apos;" type="command" category="other"><header></header><code></code><translations></translations><inputs><input type="%upvar"></input><input type="%s"></input></inputs><script><block s="doSetVar"><l>var</l><block var="value"/></block></script></block-definition><block-definition s="Forget Hugging Face key" type="command" category="other"><comment x="0" y="0" w="456.75069754464295" collapsed="true">if you entered your Hugging Face API key into the browser&apos;s local storage this will remove it.</comment><header></header><code></code><translations></translations><inputs></inputs><script><block s="doSetVar"><l>huggingface api key</l><l>0</l></block><block s="doApplyExtension"><l>db_remove(key)</l><list><l>Hugging Face</l></list></block></script></block-definition><block-definition s="parameters %&apos;inputs&apos;" type="reporter" category="Hugging Face"><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"parameters":{</l><custom-block s="separate with commas %l"><block var="inputs"/></custom-block><l>}</l></list></block></block></script></block-definition><block-definition s="separate with commas %&apos;list&apos;" type="reporter" category="lists"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l></l><l>,</l></list></block></autolambda><list></list></block><custom-block s="all but last %l"><block var="list"/></custom-block></block><block s="reportListItem"><l><option>last</option></l><block var="list"/></block></list></block></block></script></block-definition><block-definition s="candidate labels %&apos;labels&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="322.14285714285717" collapsed="false">Input are texts that are potential classes for inputs. (max 10 candidate_labels, for more, simply run multiple requests, results are going to be misleading if using too many candidate labels anyway. If you want to keep the exact same, you can simply run multi label=True and do the scaling on your end. )</comment><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doIf"><block s="reportGreaterThan"><block s="reportListAttribute"><l><option>length</option></l><block var="labels"/></block><l>10</l></block><script><block s="bubble"><l>Maximum number of candidate labels is 10. You can run multiple times with different labels and combine the results.</l></block></script></block><block s="doReport"><block s="reportJoinWords"><list><l>"candidate_labels": [</l><custom-block s="separate with commas %l"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="quote %txt"><l></l></custom-block></autolambda><list></list></block><block var="labels"/></block></custom-block><l>]</l></list></block></block></script></block-definition><block-definition s="multi-label %&apos;flag&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="182.85714285714286" collapsed="true">If true then classes can overlap.</comment><header></header><code></code><translations></translations><inputs><input type="%b">true</input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"multi_label": </l><block var="flag"/></list></block></block></script></block-definition><block-definition s="minimum length %&apos;n&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="284.2857142857143" collapsed="true">The minimum length in tokens of the output summary.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"min_length":</l><block var="n"/></list></block></block></script></block-definition><block-definition s="maximum length %&apos;n&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="284.2857142857143" collapsed="true">The maximum length in tokens of the output summary.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"max_length":</l><block var="n"/></list></block></block></script></block-definition><block-definition s="top k %&apos;k&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="391.42857142857144" collapsed="true">The top tokens considered within the sample operation to create new text.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"top_k":</l><block var="k"/></list></block></block></script></block-definition><block-definition s="top p %&apos;p&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="438.5714285714286" collapsed="false">Define the tokens that are within the sample` operation of text generation. Add tokens in the sample for more probable to least probable until the sum of the probabilities is greater than top p.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"top_p":</l><block var="p"/></list></block></block></script></block-definition><block-definition s="temperature %&apos;temperature&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="367.8571428571429" collapsed="false">The temperature of the sampling operation. Value is between 0 and 100. 1 means regular sampling, 0 means top k=1, 100.0 is getting closer to uniform probability.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"temperature":</l><custom-block s="float %n"><block var="temperature"/></custom-block></list></block></block></script></block-definition><block-definition s="repetition penalty %&apos;penalty&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="367.8571428571429" collapsed="false">The more a token is used within generation the more it is penalized to not be picked in successive generation passes. Value is between 0 and 100.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"repetition_penalty":</l><custom-block s="float %n"><block var="penalty"/></custom-block></list></block></block></script></block-definition><block-definition s="maximum time %&apos;maximum time&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="367.8571428571429" collapsed="false">The maximu amount of time in seconds that the query should take. Network can cause some overhead so it will be a soft limit. Value is between 0 and 120.</comment><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"max_time":</l><custom-block s="float %n"><block var="maximum time"/></custom-block></list></block></block></script></block-definition><block-definition s="inputs %&apos;inputs&apos;" type="reporter" category="Hugging Face"><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"inputs":{</l><custom-block s="separate with commas %l"><block s="reportCONS"><block s="reportJoinWords"><list><l>"text":</l><custom-block s="quote %txt"><block s="reportListItem"><l>1</l><block var="inputs"/></block></custom-block></list></block><block s="reportCDR"><block var="inputs"/></block></block></custom-block><l>}</l></list></block></block></script></block-definition><block-definition s="past user inputs %&apos;text or texts&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="220" collapsed="true">Input can either be text or a list of texts.</comment><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doIfElse"><block s="reportIsA"><block var="text or texts"/><l><option>text</option></l></block><script><block s="doReport"><block s="reportJoinWords"><list><l>"past_user_inputs": [</l><custom-block s="quote %txt"><block var="text or texts"/></custom-block><l>]</l></list></block></block></script><script><block s="doReport"><block s="reportJoinWords"><list><l>"past_user_inputs": [</l><custom-block s="separate with commas %l"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="quote %txt"><l></l></custom-block></autolambda><list></list></block><block var="text or texts"/></block></custom-block><l>]</l></list></block></block></script></block></script></block-definition><block-definition s="generated responses %&apos;text or texts&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="220" collapsed="true">Input can either be text or a list of texts.</comment><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doIfElse"><block s="reportIsA"><block var="text or texts"/><l><option>text</option></l></block><script><block s="doReport"><block s="reportJoinWords"><list><l>"generated_responses": [</l><custom-block s="quote %txt"><block var="text or texts"/></custom-block><l>]</l></list></block></block></script><script><block s="doReport"><block s="reportJoinWords"><list><l>"generated_responses": [</l><custom-block s="separate with commas %l"><block s="reportMap"><block s="reifyReporter"><autolambda><custom-block s="quote %txt"><l></l></custom-block></autolambda><list></list></block><block var="text or texts"/></block></custom-block><l>]</l></list></block></block></script></block></script></block-definition><block-definition s="float %&apos;x&apos;" type="reporter" category="Hugging Face"><header></header><code></code><translations></translations><inputs><input type="%n"></input></inputs><script><block s="doReport"><block s="reportIfElse"><block s="reportEquals"><block s="reportRound"><block var="x"/></block><block var="x"/></block><block s="reportJoinWords"><list><block s="reportRound"><block var="x"/></block><l>.0</l></list></block><block var="x"/></block></block></script></block-definition><block-definition s="table as a list of lists of text keys and lists %&apos;table&apos;" type="reporter" category="Hugging Face"><header></header><code></code><translations></translations><inputs><input type="%l"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"table":{</l><custom-block s="separate with commas %l"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l>"</l><block s="reportListItem"><l>1</l><block var="key and list"/></block><l>":[</l><custom-block s="separate with commas %l"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportIfElse"><block s="reportIsA"><l></l><l><option>number</option></l></block><l></l><block s="reportJoinWords"><list><l>"</l><l></l><l>"</l></list></block></block></autolambda><list></list></block><block s="reportListItem"><l>2</l><block var="key and list"/></block></block></custom-block><l>]</l></list></block></autolambda><list><l>key and list</l></list></block><block var="table"/></block></custom-block><l>}</l></list></block></block></script></block-definition><block-definition s="csv url %&apos;url&apos; to table JSON" type="reporter" category="Hugging Face"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><custom-block s="let %upvar be %s"><l>spreadsheet</l><block s="reportTextSplit"><block s="reportURL"><block var="url"/></block><l><option>csv</option></l></block></custom-block><custom-block s="let %upvar be %s"><l>keys</l><block s="reportListItem"><l>1</l><block var="spreadsheet"/></block></custom-block><custom-block s="let %upvar be %s"><l>data</l><block s="reportCDR"><block var="spreadsheet"/></block></custom-block><custom-block s="let %upvar be %s"><l>json</l><l>{</l></custom-block><block s="doFor"><l>i</l><l>1</l><block s="reportListAttribute"><l><option>length</option></l><block var="keys"/></block><script><block s="doSetVar"><l>json</l><block s="reportJoinWords"><list><block var="json"/><l>"</l><block s="reportListItem"><block var="i"/><block var="keys"/></block><l>":[</l><custom-block s="separate with commas %l"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l>"</l><block s="reportListItem"><block var="i"/><block var="row"/></block><l>"</l></list></block></autolambda><list><l>row</l></list></block><block var="data"/></block></custom-block><l>]</l><block s="reportIfElse"><block s="reportLessThan"><block var="i"/><block s="reportListAttribute"><l><option>length</option></l><block var="keys"/></block></block><l>,</l><l></l></block></list></block></block></script></block><block s="doReport"><block s="reportJoinWords"><list><block var="json"/><l>}</l></list></block></block></script></block-definition><block-definition s="table %&apos;json&apos;" type="reporter" category="Hugging Face"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"table":</l><block var="json"/></list></block></block></script></block-definition><block-definition s="query inputs %&apos;inputs&apos;" type="reporter" category="Hugging Face"><header></header><code></code><translations></translations><inputs><input type="%mult%txt"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"inputs":{</l><custom-block s="separate with commas %l"><block s="reportCONS"><block s="reportJoinWords"><list><l>"query":"</l><block s="reportListItem"><l>1</l><block var="inputs"/></block><l>"</l></list></block><block s="reportCDR"><block var="inputs"/></block></block></custom-block><l>}</l></list></block></block></script></block-definition><block-definition s="question(s) %&apos;question or questions&apos; with context(s) %&apos;context or contexts&apos;" type="reporter" category="Hugging Face"><comment x="0" y="0" w="363.5714285714286" collapsed="false">This can be used to answer several questions at once. If the first input is a list then the second input should have the same number of text elements.</comment><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%txt"></input></inputs><script><block s="doIfElse"><block s="reportIsA"><block var="question or questions"/><l><option>text</option></l></block><script><block s="doReport"><block s="reportJoinWords"><list><l>"inputs":{"question":"</l><block var="question or questions"/><l>","context":"</l><block var="context or contexts"/><l>"}</l></list></block></block></script><script><block s="doReport"><block s="reportJoinWords"><list><l>"inputs":[</l><custom-block s="separate with commas %l"><block s="reportMap"><block s="reifyReporter"><autolambda><block s="reportJoinWords"><list><l>{"question":"</l><block var="question"/><l>","context":"</l><block s="reportListItem"><block s="reportListIndex"><block var="question"/><block var="question or questions"/></block><block var="context or contexts"/></block><l>"}</l></list></block></autolambda><list><l>question</l></list></block><block var="question or questions"/></block></custom-block><l>]</l></list></block></block></script></block></script></block-definition><block-definition s="text input %&apos;text&apos;" type="reporter" category="Hugging Face"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"inputs": "</l><block var="text"/><l>"</l></list></block></block></script></block-definition><block-definition s="question %&apos;question&apos; with context %&apos;context&apos;" type="reporter" category="Hugging Face"><header></header><code></code><translations></translations><inputs><input type="%txt"></input><input type="%txt"></input></inputs><script><block s="doReport"><block s="reportJoinWords"><list><l>"inputs":{"question":"</l><block var="question"/><l>","context":"</l><block var="context"/><l>"}</l></list></block></block></script></block-definition><block-definition s="quote %&apos;text&apos;" type="reporter" category="Hugging Face"><header></header><code></code><translations></translations><inputs><input type="%txt"></input></inputs><script><custom-block s="let %upvar be %s"><l>quoted text</l><block s="reportNewList"><list></list></block></custom-block><block s="doForEach"><l>letter</l><block s="reportTextSplit"><block var="text"/><l><option>letter</option></l></block><script><block s="doIf"><block s="reportEquals"><block var="letter"/><l>"</l></block><script><block s="doAddToList"><l>\</l><block var="quoted text"/></block></script></block><block s="doAddToList"><block var="letter"/><block var="quoted text"/></block></script></block><block s="doReport"><block s="reportJoinWords"><list><l>"</l><block var="quoted text"/><l>"</l></list></block></block></script></block-definition></blocks><stage name="Stage" width="480" height="360" costume="0" color="255,255,255,1" tempo="60" threadsafe="false" penlog="false" volume="100" pan="0" lines="round" ternary="false" hyperops="true" codify="false" inheritance="true" sublistIDs="false" id="1002"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAAAXNSR0IArs4c6QAADoVJREFUeF7t1cEJAAAIxDDdf2m3sJ+4wEEQuuMIECBAgACBd4F9XzRIgAABAgQIjAB7AgIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECAiwHyBAgAABAoGAAAfoJgkQIECAgAD7AQIECBAgEAgIcIBukgABAgQICLAfIECAAAECgYAAB+gmCRAgQICAAPsBAgQIECAQCAhwgG6SAAECBAgIsB8gQIAAAQKBgAAH6CYJECBAgIAA+wECBAgQIBAICHCAbpIAAQIECByxcQFpoRMBzwAAAABJRU5ErkJggg==</pentrails><costumes><list struct="atomic" id="1003"></list></costumes><sounds><list struct="atomic" id="1004"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites select="1"><sprite name="Sprite" idx="1" x="0" y="0" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="80,80,80,1" pen="tip" id="1009"><costumes><list struct="atomic" id="1010"></list></costumes><sounds><list struct="atomic" id="1011"></list></sounds><blocks></blocks><variables></variables><scripts><script x="1124.760184151786" y="1726.47619047619"><custom-block s="csv url %txt to table JSON"><custom-block s="question(s) %txt with context(s) %txt"><block s="reportNewList"><list><l>What is my name?</l><l>Where am I from?</l><l>What year was Darwin born?</l></list></block><l>"inputs":{"question":["What is my name?","Where am I from?","What year was Darwin born?"], "context":["I live near Oxford, was born in Chicago, and am called Ken","I live near Oxford, was born in Chicago, and am called Ken","Charles Darwin and Abraham Lincoln were born on 12 February 1809]}</l></custom-block></custom-block></script><script x="42.85853794642849" y="2210.285714285714"><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><l>bert-large-uncased</l><custom-block s="get API key of Hugging Face and explain %b and ask %b"><l><bool>true</bool></l><l><bool>true</bool></l></custom-block><list><custom-block s="text or texts input %txt"><block s="reportNewList"><list><l>Snap! is very [MASK]!</l><l>Some people don&apos;t like block-based [MASK].</l></list></block></custom-block></list><comment w="250.00000000000003" collapsed="true">You can just enter text if you have only one text.</comment></custom-block></script><comment x="43.287109374999936" y="2150" w="483.5714285714286" collapsed="false">Fills in the blank (indicated by [MASK] in text. More details at&#xD;https://api-inference.huggingface.co/docs/curl/html/detailed_parameters.html#text2text-generation-task</comment><script x="40.71568080357135" y="2005.9999999999998"><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><l>dbmdz/bert-large-cased-finetuned-conll03-english</l><custom-block s="get API key of Hugging Face and explain %b and ask %b"><l><bool>true</bool></l><l><bool>true</bool></l></custom-block><list><custom-block s="text or texts input %txt"><custom-block s="multiline %mlt"><l>The web-based Snap! and older desktop-based BYOB have been both developed by Jens Mönig for Windows, OS X and Linux&#xD;with design ideas and documentation provided by Brian Harvey from University of California, Berkeley&#xD;and have been used to teach "The Beauty and Joy of Computing" introductory course in computer science for non-CS-major students.</l></custom-block></custom-block></list></custom-block></script><comment x="41.1442522321428" y="1947.1428571428569" w="539.2682756696429" collapsed="false">Finds named enties in some text. More details at&#xD;https://api-inference.huggingface.co/docs/curl/html/detailed_parameters.html#named-entity-recognition-ner-task</comment><script x="40.71568080357135" y="1857.8333333333321"><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><l>distilbert-base-uncased-finetuned-sst-2-english</l><custom-block s="get API key of Hugging Face and explain %b and ask %b"><l><bool>true</bool></l><l><bool>true</bool></l></custom-block><list><custom-block s="text or texts input %txt"><block s="reportNewList"><list><l>Snap! is very cool!</l><l>Some people don&apos;t like block-based languages.</l></list></block></custom-block></list><comment w="250.00000000000003" collapsed="true">You can just enter text if you have only one text.</comment></custom-block></script><comment x="41.85853794642851" y="1786.8333333333321" w="467.8571428571429" collapsed="false">Reports how positive or negative the text is. More details at&#xD;https://api-inference.huggingface.co/docs/curl/html/detailed_parameters.html#text-classification-task</comment><script x="41.42996651785707" y="1698.3333333333326"><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><l>deepset/roberta-base-squad2</l><custom-block s="get API key of Hugging Face and explain %b and ask %b"><l><bool>true</bool></l><l><bool>true</bool></l></custom-block><list><custom-block s="question %txt with context %txt"><l>Where is he from?</l><l>He lives near Oxford, was born in Chicago, and is called Ken</l></custom-block></list></custom-block></script><script x="40.001395089285715" y="1484.8809523809518"><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><l>google/tapas-base-finetuned-wtq</l><custom-block s="get API key of Hugging Face and explain %b and ask %b"><l><bool>true</bool></l><l><bool>true</bool></l></custom-block><list><custom-block s="query inputs %mult%txt"><list><l>What was Goofy&apos;s first film?</l><custom-block s="table %txt"><custom-block s="csv url %txt to table JSON"><l>http://localhost:8000/ai/resources/cartoons.csv</l></custom-block></custom-block></list></custom-block><custom-block s="parameters %mult%txt"><list><custom-block s="minimum length %n"><l>30</l></custom-block><custom-block s="maximum length %n"><l>40</l></custom-block><custom-block s="repetition penalty %n"><l>50</l></custom-block></list></custom-block></list></custom-block></script><script x="40.42996651785708" y="1456.5952380952374"><block s="reportURL"><l>https://ecraft2learn.github.io/ai/resources/cartoons.csv</l><comment w="248.57142857142875" collapsed="true">Click to see what table is being queried below.</comment></block></script><comment x="39.00139508928565" y="1395.1904761904755" w="493.94810267857144" collapsed="false">The following model takes a query and table and generates an answer. More details at&#xD;https://api-inference.huggingface.co/docs/curl/html/detailed_parameters.html#table-question-answering-task</comment><script x="40" y="969.4047619047618"><custom-block s="let %upvar be %s"><l>past inputs</l><block s="reportNewList"><list></list></block></custom-block><custom-block s="let %upvar be %s"><l>generated responses</l><block s="reportNewList"><list></list></block></custom-block><custom-block s="let %upvar be %s"><l>discuss</l><block s="reifyScript"><script><block s="doAsk"><block var="input"/></block><custom-block s="let %upvar be %s"><l>response</l><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><l>microsoft/DialoGPT-large</l><custom-block s="get API key of Hugging Face and explain %b and ask %b"><l><bool>true</bool></l><l><bool>true</bool></l></custom-block><list><custom-block s="inputs %mult%txt"><list><block s="getLastAnswer"></block><custom-block s="past user inputs %txt"><block var="past inputs"/></custom-block><custom-block s="generated responses %txt"><block var="generated responses"/></custom-block></list></custom-block><custom-block s="parameters %mult%txt"><list><custom-block s="temperature %n"><l>3</l></custom-block><custom-block s="maximum length %n"><l>40</l></custom-block><custom-block s="repetition penalty %n"><l>50</l></custom-block></list></custom-block></list></custom-block></custom-block><custom-block s="let %upvar be %s"><l>generated text</l><custom-block s="lookup value of %txt in %l"><l>generated_text</l><block var="response"/></custom-block></custom-block><block s="doAddToList"><block s="getLastAnswer"></block><block var="past inputs"/></block><block s="doAddToList"><block var="generated text"/><block var="generated responses"/></block><block s="doRun"><block var="discuss"/><list><block var="generated text"/></list></block></script><list><l>input</l></list></block></custom-block><block s="doRun"><block var="discuss"/><list><l>Hi. What do you want to talk about?</l></list></block></script><comment x="36.1442522321428" y="902.4523809523804" w="517.1428571428572" collapsed="false">A simple use of DialoGPT-large for a conversation. Note that this should really send only the last few inputs and responses to avoid using up too much of the character input quota.</comment><script x="30.999999999999986" y="760.0238095238095"><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><l>microsoft/DialoGPT-large</l><custom-block s="get API key of Hugging Face and explain %b and ask %b"><l><bool>true</bool></l><l><bool>true</bool></l></custom-block><list><custom-block s="inputs %mult%txt"><list><l>Can you explain why ?</l><custom-block s="past user inputs %txt"><l>Which movie is the best ?</l></custom-block><custom-block s="generated responses %txt"><l>It is Dark Star for sure.</l></custom-block></list></custom-block><custom-block s="parameters %mult%txt"><list><custom-block s="minimum length %n"><l>30</l></custom-block><custom-block s="maximum length %n"><l>40</l></custom-block><custom-block s="repetition penalty %n"><l>50</l></custom-block></list></custom-block></list></custom-block></script><comment x="29.00139508928565" y="700.3095238095233" w="487.8571428571429" collapsed="false">A version of GPT-2 trained for dialogs. 762M parameters 230 times smaller than GPT-3. More details at&#xD;https://api-inference.huggingface.co/docs/curl/html/detailed_parameters.html#conversational-task</comment><script x="25.999999999999986" y="484.28571428571433"><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><l>facebook/bart-large-cnn</l><custom-block s="get API key of Hugging Face and explain %b and ask %b"><l><bool>true</bool></l><l><bool>true</bool></l></custom-block><list><custom-block s="text or texts input %txt"><custom-block s="multiline %mlt"><l>The most important features that Snap! offers, but Scratch does not, include:&#xD;* expressions using anonymous functions, represented by a block inside a gray ring, having one or more empty slot(s)/argument(s) that are filled&#xD;  by a "higher order function"  (the one that is calling the anonymous one). (Their computer-science theoretical basis is First class functions,&#xD;  which in turn have   Lambda calculus as their even more abstract, mathematical, foundation),&#xD;* lists that are first class (including lists of lists/arrays),&#xD;* First class sprites (in other words prototype-oriented instance-based classless programming),&#xD;* "Hyperblocks": functions whose natural domain is scalars (text or numbers), extended to accept lists as inputs and apply the underlying function&#xD;  to the scalars in the list or a sublist, nestable sprites,&#xD;* codification of Snap! programs to text languages such as Python, JavaScript, C, etc.</l></custom-block></custom-block><custom-block s="parameters %mult%txt"><list><custom-block s="minimum length %n"><l>25</l></custom-block><custom-block s="maximum length %n"><l>30</l></custom-block></list></custom-block></list></custom-block></script><script x="524.7156808035714" y="1540"><custom-block s="table as a list of lists of text keys and lists %l"><l/></custom-block></script><comment x="519.7156808035714" y="1482.1428571428573" w="262.14285714285717" collapsed="false">Instead of a spreadsheet you can construct a table as a&#xD;list of lists and use the following:</comment><script x="23.142857142857128" y="302.8571428571429"><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><l>facebook/bart-large-mnli</l><custom-block s="get API key of Hugging Face and explain %b and ask %b"><l><bool>true</bool></l><l><bool>true</bool></l></custom-block><list><custom-block s="text or texts input %txt"><l>Hi, I recently bought a device from your company but it is not working as advertised and I would like to get reimbursed!</l></custom-block><custom-block s="parameters %mult%txt"><list><custom-block s="candidate labels %mult%txt"><list><l>refund</l><l>faq</l><l>legal</l></list></custom-block><custom-block s="multi-label %b"><l><bool>false</bool></l></custom-block></list></custom-block></list></custom-block></script><comment x="22.142857142857146" y="236.8571428571428" w="484.69168526785717" collapsed="false">Given some text and a list of labels this will score how well each label fits the text.&#xD;If multi-label is true then it predicts the probability that each label is correct. Details at&#xD;https://api-inference.huggingface.co/docs/curl/html/detailed_parameters.html#zero-shot-classification-task</comment><script x="17.857142857142858" y="142.71428571428552"><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><l>Helsinki-NLP/opus-mt-en-fr</l><custom-block s="get API key of Hugging Face and explain %b and ask %b"><l><bool>true</bool></l><l><bool>true</bool></l></custom-block><list><custom-block s="text or texts input %txt"><l>This is a "test" of translating from English to French using a model whose name ends in en-fr..</l></custom-block></list></custom-block></script><script x="40" y="2500.2619047619046"><block s="receiveGo"></block><block s="bubble"><l>Look at the scripts by minimzing the stage or clicking &apos;Edit&apos; in the Projects Explorer.</l></block></script><comment x="42.142857142857146" y="2319.0000000000005" w="421.42857142857144" collapsed="false">Reports the part of speech for each word in a sentence. The tags are described here&#xD;https://huggingface.co/flair/pos-english</comment><script x="42.428571428571416" y="2376.404761904762"><custom-block s="Hugging face model %txt with key %txt %br with input %mult%s"><l>flair/pos-english</l><custom-block s="get API key of Hugging Face and explain %b and ask %b"><l><bool>true</bool></l><l><bool>true</bool></l></custom-block><list><custom-block s="text input %txt"><l>Colorless green ideas sleep furiously.</l></custom-block></list></custom-block></script><script x="45" y="2460.1190476190473"><custom-block s="Forget Hugging Face key"><comment w="406.4285714285716" collapsed="true">If you stored your key in the browser&apos;s local storage and want to remove it.</comment></custom-block></script><comment x="25" y="404.7380952380952" w="487.8571428571429" collapsed="false">Produces a summary of some text. Length, top k, top p, temperature, repetition penality, and maximum time can optionally be controlled as parameters. Details at https://api-inference.huggingface.co/docs/curl/html/detailed_parameters.html#summarization-task&#xD;The example below is copied from Wikipedia. Note the misunderstanding of &quot;codification&quot;.</comment><comment x="40.42996651785708" y="1636.1190476190463" w="467.14285714285717" collapsed="false">Given a context, answers a question. More details at&#xD;https://api-inference.huggingface.co/docs/curl/html/detailed_parameters.html#question-answering-task</comment><comment x="17.57282366071422" y="75.71428571428572" w="351.42857142857144" collapsed="false">Translates text from English to French (en-fr)&#xD;Over 1300 translation models can be found at&#xD;https://huggingface.co/Helsinki-NLP</comment><comment x="7.142857142857143" y="7.142857142857143" w="337.8571428571429" collapsed="false">Below are examples of using a few of Hugging Face&apos;s over 20,000 models.&#xD;You will need an API token from huggingface.co to run these.</comment></scripts></sprite><watcher var="huggingface api key" style="normal" x="10" y="10" color="243,118,29" hidden="true"/></sprites></stage><variables><variable name="huggingface api key" transient="true"/></variables></scene></scenes></project><media name="Hugging Face models" app="Snap! 7, https://snap.berkeley.edu" version="2"></media></snapdata>