<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel rdf:about="https://community.wolfram.com">
    <title>Community RSS Feed</title>
    <link>https://community.wolfram.com</link>
    <description>RSS Feed for Wolfram Community showing any discussions tagged with Computational Humanities sorted by most replies.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2498984" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1093926" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1432072" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2445356" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1677058" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1727272" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/932548" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2135869" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2626487" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/566363" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2542490" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2316573" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2858759" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2516662" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1732586" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/3067969" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1379001" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1962739" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2847286" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1007290" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2498984">
    <title>Computational Art Contest 2022</title>
    <link>https://community.wolfram.com/groups/-/m/t/2498984</link>
    <description>&amp;gt; *SHARE this contest*: https://wolfr.am/CompArt-22 &#xD;
&#xD;
# WINNERS&#xD;
&#xD;
Thank you to everyone who submitted entries into this contest! It was a blast to see all the amazing art you created. After deliberation by our judges, these are the winners:&#xD;
&#xD;
- **Honorable Mention**: ARTIST: [Daniel Hoffmann][1], EXHIBIT: &amp;#034;[The Memory of Persistence][2]&amp;#034;&#xD;
&#xD;
- **Staff Winner**: ARTIST: [Anton Antonov][3], EXHIBIT: &amp;#034;[Rorschach mask animations projected over 3D surfaces][4]&amp;#034;&#xD;
&#xD;
- **3rd Place**: ARTIST: [Jacqueline Doan][5], EXHIBIT: &amp;#034;[Kuramoto oscillators with phase lag][6]&amp;#034;&#xD;
&#xD;
- **2nd Place**: ARTIST: [Tom Verhoeff][7], EXHIBIT: &amp;#034;[Sculpture from 18 congruent pieces][8]&amp;#034;&#xD;
&#xD;
- **1st Place**: ARTIST: [Frederick Wu][9], EXHIBIT: &amp;#034;[Love heart jewelry IV: the giving tree][10]&amp;#034;&#xD;
&#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
# CONTEST&#xD;
&#xD;
Flex your creative and computational skill with Wolfram&amp;#039;s Computational Art Contest that kicks off today, Monday, March 28th! Share your work with the community, and potentially win free Wolfram merchandise. Programmers and artists of all skill levels are encouraged to participate!&#xD;
&#xD;
This contest is inspired by Genuary, an annual project releasing generative art prompts during the month of January. We&amp;#039;re elated to see the creative works of our users and engage with the community while exploring the scope of computational art within the Wolfram Language.&#xD;
&#xD;
## Rules &amp;amp; Guidelines ##&#xD;
&#xD;
 - Submission deadline is April 25th at 9am Central Time. Posts posted&#xD;
   after will not be included in judging&#xD;
   &#xD;
 - Participants must fill out a detailed Community profile ( example:&#xD;
   https://community.wolfram.com/web/claytonshonkwiler ) and create a&#xD;
   Community post about their submission. The post must include the code&#xD;
   used to create graphics and the final piece of art placed at the top&#xD;
   of the post. An explanation of how their code works is required,&#xD;
   moreover participants are encouraged to write more about their&#xD;
   creative process.&#xD;
   &#xD;
 - Participants submit their entry by commenting on this post with an&#xD;
   image of their art, along with a link to their Community post&#xD;
   &#xD;
 - Multiple submissions per participant are allowed, but please keep the&#xD;
   number of submissions under three&#xD;
   &#xD;
 - Each participant can only win once. Participants&amp;#039; best-performing&#xD;
   piece, as determined by the judges, will be used when determining&#xD;
   winners&#xD;
   &#xD;
 - Both static images and animations can be submitted. Animations are&#xD;
   preferred in a GIF format; if the animation is too large for a GIF,&#xD;
   the post can point to a public YouTube video.&#xD;
   &#xD;
 - Submissions will be judged by a handful of Wolfram experts, with the&#xD;
   following parameters:   &#xD;
       - Visual aesthetics&#xD;
       - Wolfram Language code&#xD;
       - Creativity&#xD;
       - Explanation of process&#xD;
   &#xD;
 - Submissions from all areas of computational art are welcome&#xD;
   &#xD;
 - Submissions from former or current Wolfram employees are allowed, but&#xD;
   will be judged as their own category with only one winner&#xD;
   &#xD;
 - Submitting previous work/posts is allowed, but must meet the&#xD;
   requirements stated above&#xD;
&#xD;
## Encouragements ##&#xD;
&#xD;
 - Not sure where to start? We encourage you to look at other user&amp;#039;s&#xD;
   submission for inspiration, or look at some of the work in the visual&#xD;
   arts group of Community: &#xD;
       - Artists&amp;#039; group: https://wolfr.am/ART-examples &#xD;
       - Artist (see Staff Picks section): https://community.wolfram.com/web/claytonshonkwiler&#xD;
   &#xD;
 - We encourage you to vote and comment on other people&amp;#039;s submissions.&#xD;
   &#xD;
 - Please spread the word about this competition, among your friends and&#xD;
   other social media!&#xD;
&#xD;
## Prizes ##&#xD;
&#xD;
First, second, and third place winners will be featured on all of Wolfram&amp;#039;s social media accounts, as well as receiving their choice of free Wolfram merchandise. We are able to ship merchandise to countries listed on the Wolfram Store: https://store.wolfram.com. If your country is not listed on the Wolfram Store, we strongly encourage you to still submit an entry, as we will feature winners submissions regardless of location.&#xD;
&#xD;
### Important ###&#xD;
&#xD;
All contest rules have been explained above under Rules &amp;amp; Guidelines. It&amp;#039;s encouraged for all participants to read the rules carefully to prevent disqualification. If you have any additional questions, ask directly in the thread comments or contact us by email at t-artcontest@wolfram.com . We recommend reading other people comments as they clarify the nature of the contest as well. Comments deemed by moderators as superfluous to the thread may be removed or transferred by moderators to keep competition professional.&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com/web/danielsanderhoffmann&#xD;
  [2]: https://community.wolfram.com/groups/-/m/t/2518220&#xD;
  [3]: https://community.wolfram.com/web/antononcube&#xD;
  [4]: https://community.wolfram.com/groups/-/m/t/2518279&#xD;
  [5]: https://community.wolfram.com/web/jacquelinengocdoan&#xD;
  [6]: https://community.wolfram.com/groups/-/m/t/2509110&#xD;
  [7]: https://community.wolfram.com/web/tverhoeff&#xD;
  [8]: https://community.wolfram.com/groups/-/m/t/2513265&#xD;
  [9]: https://community.wolfram.com/web/wufei1978&#xD;
  [10]: https://community.wolfram.com/groups/-/m/t/2430827&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=news-congrads-kkluyshnik-02-04-19.jpg&amp;amp;userId=11733</description>
    <dc:creator>Eryn Gillam</dc:creator>
    <dc:date>2022-03-28T17:35:43Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1093926">
    <title>Transfer an artistic style to an image</title>
    <link>https://community.wolfram.com/groups/-/m/t/1093926</link>
    <description>![enter image description here][16]&#xD;
&#xD;
# Introduction &#xD;
&#xD;
Back in [Wolfram Summer School 2016][1] I worked on the project &amp;#034;Image Transformation with Neural Networks: Real-Time Style Transfer and Super-Resolution&amp;#034;, which got later [published on Wolfram Community][2]. At the time I had to use the MXNetLink package, but now all the needed functionality is built-in, so here is a top-level implementation of artistic style transfer with Wolfram Language. This is a slightly simplified version of the original method, as it uses a single VGG layer to extract the style features, but a full implementation is of course possible with minor modifications to the code. You can also find this example in the docs: &#xD;
&#xD;
[NetTrain][3] &amp;gt;&amp;gt; Applications &amp;gt;&amp;gt; Computer Vision &amp;gt;&amp;gt; Style Transfer &#xD;
&#xD;
# Code&#xD;
&#xD;
Create a new image with the content of a given image and in the style of another given image. This implementation follows the method described in Gatys et al., *A Neural Algorithm of Artistic Style*. An example content and style image:&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
To create the image which is a mix of both of these images, start by obtaining a pre-trained image classification network:&#xD;
&#xD;
    vggNet = NetModel[&amp;#034;VGG-16 Trained on ImageNet Competition Data&amp;#034;];&#xD;
Take a subnet that will be used as a feature extractor for the style and content images:&#xD;
&#xD;
    featureNet = Take[vggNet, {1, &amp;#034;relu4_1&amp;#034;}]&#xD;
![enter image description here][5]&#xD;
&#xD;
There are three loss functions used. The first loss ensures that the &amp;#034;content&amp;#034; is similar in the synthesized image and the content image:&#xD;
&#xD;
    contentLoss = NetGraph[{MeanSquaredLossLayer[]}, {1 -&amp;gt; NetPort[&amp;#034;LossContent&amp;#034;]}]&#xD;
![enter image description here][6]&#xD;
&#xD;
The second loss ensures that the &amp;#034;style&amp;#034; is similar in the synthesized image and the style image. Style similarity is defined as the mean-squared difference between the Gram matrices of the input and target:&#xD;
&#xD;
    gramMatrix = NetGraph[{FlattenLayer[-1], TransposeLayer[1 -&amp;gt; 2],   DotLayer[]}, {1 -&amp;gt; 3, 1 -&amp;gt; 2 -&amp;gt; 3}];&#xD;
&#xD;
    styleLoss = NetGraph[{gramMatrix, gramMatrix, MeanSquaredLossLayer[]},&#xD;
    {NetPort[&amp;#034;Input&amp;#034;] -&amp;gt; 1, NetPort[&amp;#034;Target&amp;#034;] -&amp;gt; 2, {1, 2} -&amp;gt; 3,  3 -&amp;gt; NetPort[&amp;#034;LossStyle&amp;#034;]}]&#xD;
![enter image description here][7]&#xD;
&#xD;
The third loss ensures that the magnitude of intensity changes across adjacent pixels in the synthesized image is small. This helps the synthesized image look more natural:&#xD;
&#xD;
    l2Loss = NetGraph[{ThreadingLayer[(#1 - #2)^2 &amp;amp;], SummationLayer[]}, {{NetPort[&amp;#034;Input&amp;#034;], NetPort[&amp;#034;Target&amp;#034;]} -&amp;gt; 1 -&amp;gt; 2}];&#xD;
&#xD;
    tvLoss = NetGraph[&amp;lt;|&#xD;
       &amp;#034;dx1&amp;#034; -&amp;gt; PaddingLayer[{{0, 0}, {1, 0}, {0, 0}}, &amp;#034;Padding&amp;#034; -&amp;gt; &amp;#034;Fixed&amp;#034; ],&#xD;
       &amp;#034;dx2&amp;#034; -&amp;gt;  PaddingLayer[{{0, 0}, {0, 1}, {0, 0}}, &amp;#034;Padding&amp;#034; -&amp;gt; &amp;#034;Fixed&amp;#034;],&#xD;
       &amp;#034;dy1&amp;#034; -&amp;gt;  PaddingLayer[{{0, 0}, {0, 0}, {1, 0}}, &amp;#034;Padding&amp;#034; -&amp;gt; &amp;#034;Fixed&amp;#034; ],&#xD;
       &amp;#034;dy2&amp;#034; -&amp;gt;  PaddingLayer[{{0, 0}, {0, 0}, {0, 1}}, &amp;#034;Padding&amp;#034; -&amp;gt; &amp;#034;Fixed&amp;#034;],&#xD;
       &amp;#034;lossx&amp;#034; -&amp;gt; l2Loss, &amp;#034;lossy&amp;#034; -&amp;gt; l2Loss, &amp;#034;tot&amp;#034; -&amp;gt; TotalLayer[]|&amp;gt;,&#xD;
     {{&amp;#034;dx1&amp;#034;, &amp;#034;dx2&amp;#034;} -&amp;gt; &amp;#034;lossx&amp;#034;, {&amp;#034;dy1&amp;#034;, &amp;#034;dy2&amp;#034;} -&amp;gt; &amp;#034;lossy&amp;#034;,&#xD;
       {&amp;#034;lossx&amp;#034;, &amp;#034;lossy&amp;#034;} -&amp;gt; &amp;#034;tot&amp;#034; -&amp;gt; NetPort[&amp;#034;LossTV&amp;#034;]}]&#xD;
![enter image description here][8]&#xD;
&#xD;
Define a function that creates the final training net for any content and style image. This function also creates a random initial image:&#xD;
&#xD;
    createTransferNet[net_, content_Image, styleFeatSize_] := Module[{dims = Prepend[3]@Reverse@ImageDimensions[content]},&#xD;
    NetGraph[&amp;lt;|&#xD;
    &amp;#034;Image&amp;#034; -&amp;gt; ConstantArrayLayer[&amp;#034;Array&amp;#034; -&amp;gt; RandomReal[{-0.1, 0.1}, dims]],&#xD;
    &amp;#034;imageFeat&amp;#034; -&amp;gt; NetReplacePart[net, &amp;#034;Input&amp;#034; -&amp;gt; dims],&#xD;
    &amp;#034;content&amp;#034; -&amp;gt; contentLoss,&#xD;
    &amp;#034;style&amp;#034; -&amp;gt; styleLoss,&#xD;
    &amp;#034;tv&amp;#034; -&amp;gt; tvLoss|&amp;gt;,&#xD;
    {&amp;#034;Image&amp;#034; -&amp;gt; &amp;#034;imageFeat&amp;#034;,&#xD;
    {&amp;#034;imageFeat&amp;#034;, NetPort[&amp;#034;ContentFeature&amp;#034;]} -&amp;gt; &amp;#034;content&amp;#034;,&#xD;
    {&amp;#034;imageFeat&amp;#034;, NetPort[&amp;#034;StyleFeature&amp;#034;]} -&amp;gt; &amp;#034;style&amp;#034;,&#xD;
    &amp;#034;Image&amp;#034; -&amp;gt; &amp;#034;tv&amp;#034;},&#xD;
    &amp;#034;StyleFeature&amp;#034; -&amp;gt; styleFeatSize   ] ]&#xD;
Define a [NetDecoder][9] for visualizing the predicted image:&#xD;
&#xD;
    meanIm = NetExtract[featureNet, &amp;#034;Input&amp;#034;][[&amp;#034;MeanImage&amp;#034;]]&#xD;
&#xD;
&amp;gt; {0.48502, 0.457957, 0.407604}&#xD;
&#xD;
    decoder = NetDecoder[{&amp;#034;Image&amp;#034;, &amp;#034;MeanImage&amp;#034; -&amp;gt; meanIm}]&#xD;
![enter image description here][10]&#xD;
&#xD;
The training data consists of features extracted from the content and style images. Define a feature extraction function:&#xD;
&#xD;
    extractFeatures[img_] := NetReplacePart[featureNet, &amp;#034;Input&amp;#034; -&amp;gt;NetEncoder[{&amp;#034;Image&amp;#034;, ImageDimensions[img], &#xD;
     &amp;#034;MeanImage&amp;#034; -&amp;gt;meanIm}]][img];&#xD;
&#xD;
Create a training set consisting of a single example of a content and style feature:&#xD;
&#xD;
    trainingdata = &amp;lt;|&#xD;
      &amp;#034;ContentFeature&amp;#034; -&amp;gt; {extractFeatures[contentImg]},&#xD;
       &amp;#034;StyleFeature&amp;#034; -&amp;gt; {extractFeatures[styleImg]}&#xD;
      |&amp;gt;&#xD;
Create the training net whose input dimensions correspond to the content and style image dimensions:&#xD;
&#xD;
    net = createTransferNet[featureNet, contentImg, &#xD;
       Dimensions@First@trainingdata[&amp;#034;StyleFeature&amp;#034;]];&#xD;
When training, the three losses are weighted differently to set the relative importance of the content and style. These values might need to be changed with different content and style images. Create a loss specification that defines the final loss as a combination of the three losses:&#xD;
&#xD;
    perPixel = 1/(3*Apply[Times, ImageDimensions[contentImg]]);&#xD;
    lossSpec = {&amp;#034;LossContent&amp;#034; -&amp;gt; Scaled[6.*10^-5], &#xD;
       &amp;#034;LossStyle&amp;#034; -&amp;gt; Scaled[0.5*10^-14], &#xD;
       &amp;#034;LossTV&amp;#034; -&amp;gt; Scaled[20.*perPixel]};&#xD;
Optimize the image using [NetTrain][11]. [LearningRateMultipliers][12] are used to freeze all parameters in the net except for the [ConstantArrayLayer][13]. The training is best done on a GPU, as it will take up to an hour to get good results with CPU training. The training can be stopped at any time via Evaluation -&amp;gt; Abort Evaluation:&#xD;
&#xD;
    trainedNet = NetTrain[net,&#xD;
      trainingdata, lossSpec,&#xD;
      LearningRateMultipliers -&amp;gt; {&amp;#034;Image&amp;#034; -&amp;gt; 1, _ -&amp;gt; None},&#xD;
      TrainingProgressReporting -&amp;gt; &#xD;
       Function[decoder[#Weights[{&amp;#034;Image&amp;#034;, &amp;#034;Array&amp;#034;}]]],&#xD;
      MaxTrainingRounds -&amp;gt; 300, BatchSize -&amp;gt; 1,&#xD;
      Method -&amp;gt; {&amp;#034;ADAM&amp;#034;, &amp;#034;InitialLearningRate&amp;#034; -&amp;gt; 0.05},&#xD;
      TargetDevice -&amp;gt; &amp;#034;GPU&amp;#034;&#xD;
      ]&#xD;
![enter image description here][14]&#xD;
&#xD;
Extract the final image from the [ConstantArrayLayer][15] of the trained net:&#xD;
&#xD;
    decoder[NetExtract[trainedNet, {&amp;#034;Image&amp;#034;, &amp;#034;Array&amp;#034;}]]&#xD;
&#xD;
![enter image description here][16]&#xD;
&#xD;
&#xD;
  [1]: https://education.wolfram.com/summer/school/alumni/2016/salvarezza/&#xD;
  [2]: http://community.wolfram.com/groups/-/m/t/885941&#xD;
  [3]: http://reference.wolfram.com/language/ref/NetTrain.html&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=I_432.png&amp;amp;userId=95400&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=O_179.png&amp;amp;userId=95400&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=O_180.png&amp;amp;userId=95400&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=O_181.png&amp;amp;userId=95400&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=O_182.png&amp;amp;userId=95400&#xD;
  [9]: http://reference.wolfram.com/language/ref/NetDecoder.html&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=O_184.png&amp;amp;userId=95400&#xD;
  [11]: http://reference.wolfram.com/language/ref/NetTrain.html&#xD;
  [12]: http://reference.wolfram.com/language/ref/LearningRateMultipliers.html&#xD;
  [13]: http://reference.wolfram.com/language/ref/ConstantArrayLayer.html&#xD;
  [14]: http://community.wolfram.com//c/portal/getImageAttachment?filename=O_185.png&amp;amp;userId=95400&#xD;
  [15]: http://reference.wolfram.com/language/ref/ConstantArrayLayer.html&#xD;
  [16]: http://community.wolfram.com//c/portal/getImageAttachment?filename=I_466.png&amp;amp;userId=95400</description>
    <dc:creator>Matteo Salvarezza</dc:creator>
    <dc:date>2017-05-15T10:33:59Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1432072">
    <title>[CALL] For Curious Cases of Words&amp;#039; Histories</title>
    <link>https://community.wolfram.com/groups/-/m/t/1432072</link>
    <description>*NOTE: This is a long page with many images. Scroll through to find some gems.*&#xD;
&#xD;
----------&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
&#xD;
[WordFrequencyData][4] is a nifty instrument for mining oceans of texts and discovering wonderful historical semantic curiosities. **This post is a call for you to share your discoveries of interesting word histories**. Rules are very simple.&#xD;
&#xD;
- Post you discovery as a comment on this thread&#xD;
&#xD;
- Your discovery should be curious histories of some words that can be seen in their WordFrequencyData&#xD;
&#xD;
- Start your comment with a title clearly indicating the meaning of your discovery (use # as the first character to make a title)&#xD;
&#xD;
-  Your comment must contain a plot WordFrequencyData of your terms. You can use the function I provide below. Alternatively you can use your own what to visualize WordFrequencyData.&#xD;
&#xD;
-  Your comment must contain Wolfram Language code you use to make the plot&#xD;
&#xD;
- Your comment must contain some text explaining why you think the words you found are curious and interesting in your opinion &#xD;
&#xD;
- *If you want to comment on someone&amp;#039;s work please click REPLY to his/her specific post so it is clear to what you refer and nested structure of comments is preserved.*&#xD;
&#xD;
Please see comment below for good examples.&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
### FUNCTION for PLOTs&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
Feel free to use this function for your visualizations and change or  improve it if you wish. Note what kind of options you can provide to this plot. I tried to limit those options to only very important once, fixing other options to make a nice plot.&#xD;
&#xD;
&#xD;
&#xD;
    ClearAll@WordFrequencyPlot;&#xD;
    &#xD;
    Options[WordFrequencyPlot]=&#xD;
    {&amp;#034;YearStart&amp;#034;-&amp;gt;1800,&amp;#034;YearEnd&amp;#034;-&amp;gt;Now,&amp;#034;Case&amp;#034;-&amp;gt;True,&#xD;
    &amp;#034;Smooth&amp;#034;-&amp;gt;3,&amp;#034;Scaling&amp;#034;-&amp;gt;None,&amp;#034;Style&amp;#034;-&amp;gt;Automatic};&#xD;
    &#xD;
    WordFrequencyPlot[words_,OptionsPattern[]]:=&#xD;
    With[{&#xD;
    	$data=WordFrequencyData[words,&amp;#034;TimeSeries&amp;#034;,&#xD;
    		{OptionValue[&amp;#034;YearStart&amp;#034;],OptionValue[&amp;#034;YearEnd&amp;#034;]},&#xD;
    		IgnoreCase-&amp;gt;OptionValue[&amp;#034;Case&amp;#034;]]},&#xD;
    	DateListPlot[&#xD;
    		MapThread[Callout,&#xD;
    			{MeanFilter[#,Quantity[OptionValue[&amp;#034;Smooth&amp;#034;],&amp;#034;Years&amp;#034;]]&amp;amp;/@&#xD;
    			Values[$data],words}],&#xD;
    		ScalingFunctions-&amp;gt;OptionValue[&amp;#034;Scaling&amp;#034;],&#xD;
    		PlotRange-&amp;gt;All,&#xD;
    		PlotTheme-&amp;gt;&amp;#034;Detailed&amp;#034;,&#xD;
    		PlotStyle-&amp;gt;OptionValue[&amp;#034;Style&amp;#034;],&#xD;
    		FrameTicks-&amp;gt;{Automatic,None},&#xD;
    		ImageSize-&amp;gt;Large,&#xD;
    		FrameLabel-&amp;gt;{&amp;#034;YEAR&amp;#034;,&amp;#034;FREQUENCY in TEXT&amp;#034;}]&#xD;
    ]&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-09-04at5.02.04PM.png&amp;amp;userId=11733&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-08-30at8.19.02PM.png&amp;amp;userId=20103&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-09-04at12.48.22PM.png&amp;amp;userId=11733&#xD;
  [4]: http://reference.wolfram.com/language/ref/WordFrequencyData.html</description>
    <dc:creator>Vitaliy Kaurov</dc:creator>
    <dc:date>2018-08-30T21:41:25Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2445356">
    <title>A Wolfram Language facsimile of Wordle</title>
    <link>https://community.wolfram.com/groups/-/m/t/2445356</link>
    <description>![enter image description here][1]&#xD;
&#xD;
The popular game Wordle can take up a lot of your time.  The author designed it so that it you can only play it once a day, thus saving us from ourselves :-).&#xD;
&#xD;
[Wordle][2]&#xD;
&#xD;
[NYTimes article on Wordle][3]&#xD;
&#xD;
But I couldn&amp;#039;t resist the challenge to create a version of it in Mathematica, just for fun and because I was bored this past weekend. &#xD;
&#xD;
See the attached notebook and enjoy.  Alas, since you can run it any number of times you are only to blame for yourself it you spend too much time on it. &#xD;
&#xD;
After executing the notebook just execute &#xD;
&#xD;
    MWordle[Deploy]&#xD;
&#xD;
to bring up the game.&#xD;
&#xD;
A few additional comments.  The notebook MWordle.nb has the option&#xD;
&#xD;
AutoGeneratedPackage -&amp;gt; Automatic&#xD;
&#xD;
which causes it, when saved, to create an MWordle.m package file in its same directory. &#xD;
&#xD;
The code in MWordle.nb is set up as a package with the context MWordle`Mwordle`&#xD;
&#xD;
If you want to set things up so that the package gets loaded and the MWordle game is automatically launched, do the following.&#xD;
&#xD;
Create a directory MWordleGame on your disk  (The name MWordleGame can actually be whatever you wish.)  And in the MWordleGame directory create a new directory called MWordle.  (This name must be exactly that so that the MWordle`Mwordle` Context is property respected.)  Put the MWordle.nb notebook in the MWordle dierectory, open it in Mathematica and save it so that the MWordle.m file is created in the MWordle directory.  Then you can close the MWordle.nb notebook.&#xD;
&#xD;
Now in your MWordleGame directory save a new notebook -- you can call it whatever you wish, but something like LaunchMwordle.nb is a sensible choice.&#xD;
&#xD;
In that notebook create a button with the following command:&#xD;
&#xD;
&#xD;
    CellPrint[TextCell[Button[&amp;#034;Launch MWordle&amp;#034;,&#xD;
       Monitor[&#xD;
        If[! MemberQ[$Path, NotebookDirectory[]], &#xD;
         AppendTo[$Path, NotebookDirectory[]]];&#xD;
        Needs[&amp;#034;MWordle`MWordle`&amp;#034;]; MWordle`MWordle`MWordle[Deploy],&#xD;
        Row[{ProgressIndicator[Appearance -&amp;gt; &amp;#034;Necklace&amp;#034;, &#xD;
           ImageSize -&amp;gt; Small], Spacer[5], &#xD;
          Style[&amp;#034;Launching MWordle...&amp;#034;, 12, Blue, &#xD;
           FontFamily -&amp;gt; &amp;#034;Arial&amp;#034;]}]],&#xD;
       Method -&amp;gt; &amp;#034;Queued&amp;#034;], &amp;#034;Text&amp;#034;, GeneratedCell -&amp;gt; False, &#xD;
      CellAutoOverwrite -&amp;gt; False]]&#xD;
&#xD;
You now have a button in your LaunchMwordle.nb notebook which you can use any time you want to launch MWordle without having to execute the cells in the MWordle.nb notebook.&#xD;
&#xD;
Download the actual notebook from the link at the end of this post. The following is a version here to read.&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][4]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Wordle.gif&amp;amp;userId=20103&#xD;
  [2]: https://www.powerlanguage.co.uk/wordle/&#xD;
  [3]: https://www.nytimes.com/2022/01/03/technology/wordle-word-game-creator.html&#xD;
  [4]: https://www.wolframcloud.com/obj/08c015e2-0d65-4634-bf54-4b73e518f6d5</description>
    <dc:creator>David Reiss</dc:creator>
    <dc:date>2022-01-13T21:47:44Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1677058">
    <title>Computer Analysis of Poetry &amp;#x2014; Part 1: Metrical Pattern</title>
    <link>https://community.wolfram.com/groups/-/m/t/1677058</link>
    <description>This is the first part of an ongoing series. The second part can be found [here][1]. Poets pay attention to the natural stresses in words, and sometimes they arrange words so that the stresses form patterns. Typical patterns stress every other syllable (duple meter) or every third syllable (triple meter). Conventions exist to further classify poetic lines according to a unit of two or three syllables, called a *foot*. I choose not to follow this convention, instead looking at the line of poetry as a continuous pattern. The goal of step 1 is to display the pattern of a line of poetry graphically around the printed syllables .&#xD;
&#xD;
The function below accepts a line of English poetry (or prose) and returns the stress pattern with syllables. It gets the stress information from the &amp;#034;PhoneticForm&amp;#034; property in WordData and the syllabification information from the &amp;#034;Hyphenation&amp;#034; property. Sometimes words are not in WordData, or the database doesn&amp;#039;t have phonetic or hyphenation values for the word. Much of the code deals with how to guess at those values when they are missing. Also, 1-syllable words are stressed in the database, but stopwords are usually unstressed in context. So the code demotes single-syllable stopwords from stressed to undetermined. A series of replacement rules attempts to resolve syllables that the program has not yet determined to be stressed or unstressed.&#xD;
&#xD;
    analyzeMeter[verse_] := {&#xD;
       ipaVowels = {&amp;#034;a?&amp;#034;, &amp;#034;a?&amp;#034;, &amp;#034;e?&amp;#034;, &amp;#034;??&amp;#034;, &amp;#034;o?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;,&#xD;
          &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;,&#xD;
          &amp;#034;?&amp;#034;, &amp;#034;?&amp;#034;, &amp;#034;a&amp;#034;, &amp;#034;æ&amp;#034;, &amp;#034;e&amp;#034;, &amp;#034;i&amp;#034;, &amp;#034;o&amp;#034;, &amp;#034;&amp;#034;, &amp;#034;ø&amp;#034;, &amp;#034;u&amp;#034;, &amp;#034;y&amp;#034;};&#xD;
       words = ToLowerCase[TextWords[verse]];&#xD;
       getWordInfo[wd_] := {&#xD;
         ipa = WordData[wd, &amp;#034;PhoneticForm&amp;#034;];&#xD;
         str = If[StringQ[ipa],&#xD;
           vow = StringCases[ipa, &amp;#034;?&amp;#034; | &amp;#034;?&amp;#034; ... ~~ ipaVowels];&#xD;
           ToExpression[&#xD;
            StringReplace[&#xD;
             vow, {&amp;#034;?&amp;#034; ~~ __ -&amp;gt; &amp;#034;1&amp;#034;, &amp;#034;?&amp;#034; ~~ __ -&amp;gt; &amp;#034;.5&amp;#034;, __ -&amp;gt; &amp;#034;0&amp;#034;}]],&#xD;
           dips = {&amp;#034;ae&amp;#034;, &amp;#034;ai&amp;#034;, &amp;#034;au&amp;#034;, &amp;#034;ay&amp;#034;, &amp;#034;ea&amp;#034;, &amp;#034;ee&amp;#034;, &amp;#034;ei&amp;#034;, &amp;#034;eu&amp;#034;, &amp;#034;ey&amp;#034;, &#xD;
             &amp;#034;ie&amp;#034;, &amp;#034;oa&amp;#034;, &amp;#034;oe&amp;#034;, &amp;#034;oi&amp;#034;, &amp;#034;oo&amp;#034;, &amp;#034;ou&amp;#034;, &amp;#034;oy&amp;#034;, &amp;#034;ue&amp;#034;, &amp;#034;ui&amp;#034;, &amp;#034;uy&amp;#034;};&#xD;
           vows = {&amp;#034;a&amp;#034;, &amp;#034;e&amp;#034;, &amp;#034;i&amp;#034;, &amp;#034;o&amp;#034;, &amp;#034;u&amp;#034;, &amp;#034;y&amp;#034;};&#xD;
           Table[.5, &#xD;
            Total[ToExpression[&#xD;
              Characters[&#xD;
               StringReplace[&#xD;
                wd, {StartOfString ~~ &amp;#034;y&amp;#034; -&amp;gt; &amp;#034;0&amp;#034;, &#xD;
                 &amp;#034;e&amp;#034; ~~ EndOfString -&amp;gt; &amp;#034;0&amp;#034;, dips -&amp;gt; &amp;#034;1&amp;#034;, &#xD;
                 vows -&amp;gt; &amp;#034;1&amp;#034;, _ -&amp;gt; &amp;#034;0&amp;#034;}]]]]]];&#xD;
         hyp = WordData[wd, &amp;#034;Hyphenation&amp;#034;];&#xD;
         fauxSyl = &#xD;
          StringPartition[wd, UpTo[Ceiling[StringLength[wd]/Length[str]]]];&#xD;
         syl = &#xD;
          If[ListQ[hyp] &amp;amp;&amp;amp; Length[hyp] == Length[fauxSyl], hyp, fauxSyl];&#xD;
         {wd, str, syl}};&#xD;
       wordInfo = getWordInfo[#][[1]] &amp;amp; /@ words;&#xD;
       stops1IPA = &#xD;
        Select[DeleteMissing[&#xD;
          WordData[#, &amp;#034;PhoneticForm&amp;#034;] &amp;amp; /@ WordData[All, &amp;#034;Stopwords&amp;#034;]], &#xD;
         StringCount[#, ipaVowels] &amp;lt; 2 &amp;amp;];&#xD;
       wordInfo = &#xD;
        wordInfo /. {a_, b_List, c_} /; &#xD;
           MemberQ[stops1IPA, WordData[a, &amp;#034;PhoneticForm&amp;#034;]] -&amp;gt; {a, {.5}, c};&#xD;
       wordInfo = &#xD;
        wordInfo /. {a_, b_List, &#xD;
            c_} /; ! MemberQ[stops1IPA, WordData[a, &amp;#034;PhoneticForm&amp;#034;]] &amp;amp;&amp;amp; &#xD;
            b == {.5} -&amp;gt; {a, {1}, c};&#xD;
       preMeter = wordInfo[[;; , 2]] // Flatten;&#xD;
       meter =&#xD;
        preMeter //. {&#xD;
          {a___, .5, 1, 1, b___} -&amp;gt; {a, 0, 1, 1, b},&#xD;
          {a___, 1, 1, .5, b___} -&amp;gt; {a, 1, 1, 0, b},&#xD;
          {a___, 1, .5, 1, b___} -&amp;gt; {a, 1, 0, 1, b},&#xD;
          {a___, 0, .5, 0, b___} -&amp;gt; {a, 0, 1, 0, b},&#xD;
          {a___, .5, 1, b___} -&amp;gt; {a, 0, 1, b},&#xD;
          {a___, 1, .5, b___} -&amp;gt; {a, 1, 0, b},&#xD;
          {a___, 0, .5} -&amp;gt; {a, 0, 1},&#xD;
          {.5, 0, b___} -&amp;gt; {1, 0, b},&#xD;
          {a___, .5, 0, 1, 0, 1, b___} -&amp;gt; {a, 1, 0, 1, 0, 1, b},&#xD;
          {a___, .5, 1, 0, 1, 0, b___} -&amp;gt; {a, 0, 1, 0, 1, 0, b},&#xD;
          {a___, .5, 0, 0, 1, 0, 0, 1, b___} -&amp;gt; {a, 1, 0, 0, 1, 0, 0, 1, &#xD;
            b},&#xD;
          {a___, 1, 0, 1, 0, .5, b___} -&amp;gt; {a, 1, 0, 1, 0, 1, b},&#xD;
          {a___, 0, 1, 0, 1, .5, b___} -&amp;gt; {a, 0, 1, 0, 1, 0, b},&#xD;
          {a___, 1, 0, 0, 1, 0, 0, .5, b___} -&amp;gt; {a, 1, 0, 0, 1, 0, 0, 1, &#xD;
            b},&#xD;
          {a___, .5, .5, .5} -&amp;gt; {a, 0, 1, 0},&#xD;
          {.5, .5, b___} -&amp;gt; {1, 0, b}};&#xD;
       coords = Partition[Riffle[Range[Length[meter]], meter], 2];&#xD;
       syllab = Flatten[wordInfo[[;; , 3]]];&#xD;
       visual = &#xD;
        Graphics[{Line[coords], &#xD;
          MapIndexed[&#xD;
           Style[Text[#1, {#2[[1]], .5}], 15, FontFamily -&amp;gt; &amp;#034;Times&amp;#034;] &amp;amp;, &#xD;
           syllab]}, ImageMargins -&amp;gt; {{10, 10}, {0, 0}}, &#xD;
         ImageSize -&amp;gt; 48*Length[meter]]&#xD;
       };&#xD;
    analyzeMeter[&amp;#034;Once upon a midnight dreary, while I pondered, weak and \&#xD;
    weary,&amp;#034;]&#xD;
![enter image description here][2]&#xD;
Thanks to Edgar Allan Poe for his poem &amp;#034;The Raven.&amp;#034; The zigzag line zigs up for stressed syllables and down for unstressed. The program analyzes this verse without error or deviation from the expected meter. However, poets don&amp;#039;t always follow the expected pattern, and the program occasional makes mistakes. Consider the program&amp;#039;s output for the entire second stanza of &amp;#034;The Raven.&amp;#034;&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
The graphic makes it easy to see deviations from the pattern. In the second line of this stanza, the program mistakenly considers &amp;#034;separate&amp;#034; to have three syllables as if it were a verb. However, when &amp;#034;separate&amp;#034; is used as an adjective, as in &amp;#034;separate dying ember,&amp;#034; it only has two syllables. In the third verse, the last syllable of &amp;#034;eagerly&amp;#034; is so weak that the program marks it as unstressed. This is a reasonable and arguably correct way to assess the syllable, though traditionally it should be marked as stressed. The fifth verse also has an anomaly. Poe has added an extra syllable to the line with the word &amp;#034;radiant.&amp;#034;&#xD;
&#xD;
As an English teacher, I think this visual gives insight into such subtle poetic notions as elision, secondary stress, and masculine/feminine rhyme. A possible activity is for students to use the program to analyze the prevailing pattern in a stanza of poetry and then explain the variations from that pattern as nuances of the language (as in &amp;#034;eagerly&amp;#034;), deliberate deviations by the poet (as in &amp;#034;radiant&amp;#034;), or mistakes by the program (as in &amp;#034;separate&amp;#034;). &#xD;
&#xD;
&amp;#034;The Raven&amp;#034; follows a duple meter pattern of alternating stressed and unstressed syllables. The program can also handle poems that follow the other major metrical pattern, triple meter. Here are verses from &amp;#034;Evangeline&amp;#034; by Henry Wadsworth Longfellow and &amp;#034;&amp;#039;Twas the Night Before Christmas&amp;#034; by Clement Clarke Moore.&#xD;
![enter image description here][4]&#xD;
&#xD;
One would expect that the program would show free verse and prose as having no recognizable metrical pattern. Let&amp;#039;s see. Here are two lines of Walt Whitman&amp;#039;s free verse poem &amp;#034;When I Heard the Learn&amp;#039;d Astronomer&amp;#034;:&#xD;
![enter image description here][5]&#xD;
&#xD;
And here is a sentence from the Wikipedia article on butterflies.&#xD;
![enter image description here][6]&#xD;
&#xD;
The traditional way to teach meter in poetry is to explain about iambs, trochees, etc. and then have students try to mark lines of poetry with those units. Students, who may be distinguishing stressed syllables for the first time are hard pressed to find metrical feet in a verse. With this program, a student has a starting point to explore, analyze, interpret, and critique. It&amp;#039;s like using Wolfram Alpha to understand the graph of a rational function rather than trying to sketch it yourself following the rules the teacher lectured about.&#xD;
&#xD;
I would call the program a work in progress rather than a success. If you experiment with poems of your choice, you&amp;#039;ll find that it sometimes fails to resolve a syllable, leaving it stuck halfway between stressed and unstressed. Also, if it misinterprets a syllable, marking it stressed, for instance, when it shouldn&amp;#039;t be, the error can spread to neighboring syllables and corrupt the interpretation of the whole line. It works more consistently with duple meter than triple meter.&#xD;
&#xD;
Twice I tried to improve the program with machine learning. I thought that if machine learning could classify the unresolved pattern as either duple meter, triple meter, or neither, then the program could better resolve the undetermined syllables. I was encouraged when it had 99% confidence that lines from &amp;#034;The Raven&amp;#034; were duple meter, but then I realized it was just as certain that any input was duple meter. My second attempt was to make a neural net that accepted a word and returned a likely stress pattern. For instance, I would feed it &amp;#034;Lenore&amp;#034; and it would return {0,1}. I think this should be doable, training it on data from WordData, but I am not strong enough in machine learning to make it happen (yet).&#xD;
&#xD;
I subtitled this &amp;#034;Part 1,&amp;#034; which implies that there is more to come. I intend to follow this with a program that makes rhyme visible, including alliteration, assonance, and other sound features loosely associated with rhyme.&#xD;
&#xD;
Thanks for sticking with this to the end,&#xD;
&#xD;
Mark Greenberg&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com/groups/-/m/t/1728031&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=rav11.png&amp;amp;userId=788861&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-05-06at5.05.53PM.png&amp;amp;userId=788861&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-05-06at5.08.16PM.png&amp;amp;userId=788861&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2019-05-06at5.10.17PM.png&amp;amp;userId=788861&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=wik1.png&amp;amp;userId=788861</description>
    <dc:creator>Mark Greenberg</dc:creator>
    <dc:date>2019-05-07T00:14:16Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1727272">
    <title>Which countries did @realDonaldTrump tweet about?</title>
    <link>https://community.wolfram.com/groups/-/m/t/1727272</link>
    <description>Introduction&#xD;
----------&#xD;
&#xD;
A couple of days ago on 1 July [The Economist][1] tweeted [this][2]:&#xD;
&#xD;
&amp;gt; Since he was elected in 2016 Donald Trump has made 1,384 mentions of foreign countries on Twitter. Can you guess which one he named most often?&#xD;
&#xD;
[It claims][3] that in spite of the &amp;#034;special relationship&amp;#034; with the UK, it is only ranked 15th of the countries and territories tweeted about. It also says that Puerto Rico, Mexico and China are in fifth, fourth and third places respectively (countries and territories). According to The Economist North Korea is ranked in second place with 163 mentions. &#xD;
&#xD;
A couple of years ago I read the excellent book &amp;#034;A Mathematician Reads the Newspaper&amp;#034; by John Allen Paulos; and I wonder how much of the daily news coverage can we check using the Wolfram Language. *In a future post I will speak about another project that we are doing with several members of this community that goes in a similar direction. We call it &amp;#034;computational conversations&amp;#034;. With a bit of luck you might hear about it at the [Wolfram Technology Conference][4] later this year.*&#xD;
&#xD;
Initial analysis &#xD;
----------&#xD;
&#xD;
It turns out that I have been monitoring @realDonaldTrump&amp;#039;s tweets using IFTTT since early 2017. I attach excel files to this post. To have a look at the first tweet we first set the directory and load the raw data files: &#xD;
&#xD;
    SetDirectory[NotebookDirectory[]]&#xD;
    dataraw = Import /@ FileNames[&amp;#034;Trump*.xlsx&amp;#034;];&#xD;
&#xD;
As the first file (without a number) will be read in last (alphabetical order), this is the first tweet data:&#xD;
&#xD;
    dataraw[[5, 1, 1]] // TableForm&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
It is from January 26th, 2017, a couple of days after his inauguration. &#xD;
&#xD;
In oder to figure out which countries Mr Trump talks about we use the function TextCases, a recently updated function:&#xD;
&#xD;
&#xD;
    tweettexts = Join[dataraw[[1, 1]], dataraw[[2, 1]], dataraw[[3, 1]], dataraw[[4, 1]], dataraw[[5, 1]]][[All, 2]];&#xD;
    &#xD;
    locations =  TextCases[StringJoin[tweettexts], &amp;#034;LocationEntity&amp;#034; -&amp;gt; &amp;#034;Interpretation&amp;#034;, VerifyInterpretation -&amp;gt; True];&#xD;
&#xD;
I find &#xD;
&#xD;
    Length@locations&#xD;
&#xD;
5768 locations; these will not only include direct mentions of countries but also locations within countries. These locations will be in Entity-form:&#xD;
&#xD;
    locations[[1;;20]]&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
Let&amp;#039;s get that apart. First we make a list of all countries in the world:&#xD;
&#xD;
    purecountries = # -&amp;gt; {#} &amp;amp; /@ EntityList[EntityClass[&amp;#034;Country&amp;#034;, &amp;#034;Countries&amp;#034;]];&#xD;
&#xD;
If we select all direct mentions of countries we obtain:&#xD;
&#xD;
    Select[locations, MemberQ[purecountries[[All, 1]], #] &amp;amp;] // Length&#xD;
&#xD;
3624 mentions; if we exclude the 1349 mentions the US, we are left with 2275 country names. Despite our list starting with later tweets we obtain substantially more mentions of countries than The Economist (1,384). We can now generate a table of the mentions of all countries:&#xD;
&#xD;
    TableForm[Flatten /@ Transpose[{Range[Length[#] - 1], Delete[#, 5]}] &amp;amp;@({#[[1]], #[[2]]} &amp;amp; /@ &#xD;
    Normal[ReverseSort[Counts[CommonName@(Select[locations, MemberQ[purecountries[[All, 1]], #] &amp;amp;])]]])]&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
(This is only the top of the list.) Note, that North Korea is missing, but will be very prominent in the next table.... Next we can check for &amp;#034;indirect&amp;#034; mentions of a country, i.e. Louvre would lead to a mention of France etc. We will find many more entities and will first generate a list of substitution rules:&#xD;
&#xD;
    countriesrules = # -&amp;gt; Check[GeoIdentify[&amp;#034;Country&amp;#034;, #], {#}] &amp;amp; /@ (Complement[DeleteDuplicates[locations], EntityList[EntityClass[&amp;#034;Country&amp;#034;, &amp;#034;Countries&amp;#034;]]]);&#xD;
&#xD;
We will ignore the error messages for now. We can then generate a table that includes the &amp;#034;indirect&amp;#034; mentions, too:&#xD;
&#xD;
    TableForm[Flatten /@ Transpose[{Range[Length[#] - 1], Delete[#, 5]}] &amp;amp;@({#[[1]], #[[2]]} &amp;amp; /@ &#xD;
     Normal[ReverseSort[Counts[CommonName@(DeleteMissing[Flatten[locations /. countriesrules]])]]])]&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
Note, that on rank 4 we find Media, which is not a country. It is easy to clean out, but I leave it in to show the performance of the code so far. We could now make typical representations such as GeoBubbleCharts:&#xD;
&#xD;
    GeoBubbleChart[Counts[DeleteMissing[Flatten[locations /. countriesrules]]], GeoBackground -&amp;gt; &amp;#034;Satellite&amp;#034;]&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
We can now make a BarChart (on a logarithmic scale) selecting &amp;#034;purecountries&amp;#034; like so:&#xD;
&#xD;
    BarChart[ReverseSort@&amp;lt;|&#xD;
       Select[Normal@&#xD;
         Counts[DeleteMissing[Flatten[locations /. countriesrules]]], &#xD;
        MemberQ[purecountries[[All, 1]], #[[1]]] &amp;amp;]|&amp;gt;, &#xD;
     ScalingFunctions -&amp;gt; &amp;#034;Log&amp;#034;, &#xD;
     ChartLabels -&amp;gt; (Rotate[#, Pi/2] &amp;amp; /@ &#xD;
        CommonName[&#xD;
         ReverseSortBy[&#xD;
           Select[Normal@&#xD;
             Counts[DeleteMissing[Flatten[locations /. countriesrules]]], &#xD;
            MemberQ[purecountries[[All, 1]], #[[1]]] &amp;amp;], Last][[All, &#xD;
           1]]]), PlotTheme -&amp;gt; &amp;#034;Marketing&amp;#034;, &#xD;
     LabelStyle -&amp;gt; Directive[Bold, 15]]&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
We can also represent that on a world wide map:&#xD;
&#xD;
    styling = {GeoBackground -&amp;gt; GeoStyling[&amp;#034;StreetMapNoLabels&amp;#034;, &#xD;
    GeoStylingImageFunction -&amp;gt; (ImageAdjust@ColorNegate@ColorConvert[#1, &amp;#034;Grayscale&amp;#034;] &amp;amp;)], &#xD;
    GeoScaleBar -&amp;gt; Placed[{&amp;#034;Metric&amp;#034;, &amp;#034;Imperial&amp;#034;}, {Right, Bottom}], GeoRangePadding -&amp;gt; Full, ImageSize -&amp;gt; Large};&#xD;
    &#xD;
    GeoRegionValuePlot[&#xD;
    Log@&amp;lt;|Select[Normal@Counts[DeleteMissing[Flatten[locations /. countriesrules]]], MemberQ[purecountries[[All, 1]], #[[1]]] &amp;amp;]|&amp;gt;, Join[styling, {ColorFunction -&amp;gt; &amp;#034;TemperatureMap&amp;#034;}]]&#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
Further analysis&#xD;
----------&#xD;
&#xD;
We can of course look at many other features of the tweets. One is a simple sentiment analysis. I am not at all convinced that the result of this attempt are useful or representing an actual pattern. But this is what we could do:&#xD;
&#xD;
    emotion[text_] := &amp;#034;Positive&amp;#034; - &amp;#034;Negative&amp;#034; /. Classify[&amp;#034;Sentiment&amp;#034;, text, &amp;#034;Probabilities&amp;#034;]&#xD;
&#xD;
and then&#xD;
&#xD;
    tweetssentiments = emotion /@ tweettexts;&#xD;
    ListPlot[tweetssentiments, PlotRange -&amp;gt; All, LabelStyle -&amp;gt; &#xD;
     Directive[Bold, 15], AxesLabel -&amp;gt; {&amp;#034;tweet number&amp;#034;, &amp;#034;sentiment&amp;#034;}]&#xD;
&#xD;
![enter image description here][12]&#xD;
&#xD;
Using a SmoothHistogram, we see a pattern of &amp;#034;extremes&amp;#034;, negative, neutral, positive:&#xD;
&#xD;
    SmoothHistogram[tweetssentiments, PlotTheme -&amp;gt; &amp;#034;Marketing&amp;#034;, &#xD;
     FrameLabel -&amp;gt; {&amp;#034;sentiment&amp;#034;, &amp;#034;probablitiy&amp;#034;}, &#xD;
     LabelStyle -&amp;gt; Directive[Bold, 16], ImageSize -&amp;gt; Large]&#xD;
&#xD;
![enter image description here][13]&#xD;
&#xD;
We can also ask for less relevant information, such as the colours mentioned in the tweets:&#xD;
&#xD;
    textcasesColor = TextCases[StringJoin[tweettexts], &amp;#034;Color&amp;#034; -&amp;gt; &amp;#034;Interpretation&amp;#034;, VerifyInterpretation -&amp;gt; True]&#xD;
&#xD;
![enter image description here][14]&#xD;
&#xD;
So there is a lot of white, some black, red and green:&#xD;
&#xD;
    ReverseSort@Counts[textcasesColor]&#xD;
&#xD;
![enter image description here][15]&#xD;
&#xD;
Let&amp;#039;s blend these colours together:&#xD;
&#xD;
    Graphics[{Blend[textcasesColor], Disk[]}]&#xD;
&#xD;
![enter image description here][16]&#xD;
&#xD;
We can also look for &amp;#034;profanity&amp;#034; in tweets:&#xD;
&#xD;
    textcasesProfanity = TextCases[StringJoin[tweettexts], &amp;#034;Profanity&amp;#034;];&#xD;
&#xD;
and represent these tweets in a table:&#xD;
&#xD;
    Column[textcasesProfanity, Frame -&amp;gt; All]&#xD;
&#xD;
![enter image description here][17]&#xD;
&#xD;
It is not quite clear to my why some of the tweets are classified as containing profanity. For some tweets it is relatively obvious, I think.&#xD;
&#xD;
Twitter handles&#xD;
----------&#xD;
&#xD;
Another interesting analysis is to look at the twitter handles that @realDonaldTrump uses:&#xD;
&#xD;
    textcasesTwitterHandle = TextCases[StringJoin[tweettexts], &amp;#034;TwitterHandle&amp;#034;];&#xD;
&#xD;
Here are counts of the 50 most common handles:&#xD;
&#xD;
    twitterhandles50 = Normal[(ReverseSort@Counts[ToLowerCase /@ textcasesTwitterHandle])[[1 ;; 50]]]&#xD;
&#xD;
![enter image description here][18]&#xD;
&#xD;
Last but not least we can make a BarChart of that:&#xD;
&#xD;
    BarChart[&amp;lt;|twitterhandles50|&amp;gt;, ChartLabels -&amp;gt; (Rotate[#, Pi/2] &amp;amp; /@ twitterhandles50[[All, 1]]), &#xD;
    LabelStyle -&amp;gt; Directive[Bold, 14]]&#xD;
&#xD;
![enter image description here][19]&#xD;
&#xD;
and to compare the same on a logarithmic scale:&#xD;
&#xD;
    BarChart[&amp;lt;|twitterhandles50|&amp;gt;, ChartLabels -&amp;gt; (Rotate[#, Pi/2] &amp;amp; /@ twitterhandles50[[All, 1]]), &#xD;
    LabelStyle -&amp;gt; Directive[Bold, 14], ScalingFunctions -&amp;gt; &amp;#034;Log&amp;#034;]&#xD;
&#xD;
&#xD;
![enter image description here][20]&#xD;
&#xD;
A little word cloud&#xD;
----------&#xD;
&#xD;
Just to finish off we will generate a little word cloud like so:&#xD;
&#xD;
    allwords = Flatten[TextWords /@ tweettexts];&#xD;
    WordCloud[ToLowerCase /@ DeleteCases[DeleteStopwords[ToString /@ allwords], &amp;#034;&amp;amp;amp;&amp;#034;]]&#xD;
&#xD;
![enter image description here][21]&#xD;
&#xD;
The cloud picks up on &amp;#034;witch hunt&amp;#034; and &amp;#034;collusion&amp;#034;, &amp;#034;@foxandfrieds&amp;#034; and &amp;#034;Russia&amp;#034;, &amp;#034;fake&amp;#034;, &amp;#034;border&amp;#034; as well as other terms that indeed are relatively prominent in the media. &#xD;
&#xD;
Conclusion&#xD;
----------&#xD;
&#xD;
The main objective of this was to look try to reproduce at least qualitatively the results of the twitter analysis of @realDonaldTrump&amp;#039;s tweets by The Economist using the Wolfram Language. We have been using a slightly different period of the tweets. We have been looking at direct mentions and &amp;#034;indirect&amp;#034; ones. I have not made any manual comparison of the results. I am not sure whether the recognition has worked and I only post it as a first cursory analysis. &#xD;
&#xD;
It was relatively easy to go beyond the analysis and look at other features of the tweets, too.&#xD;
&#xD;
&#xD;
  [1]: https://www.economist.com&#xD;
  [2]: https://twitter.com/TheEconomist/status/1145467208950329344&#xD;
  [3]: https://www.economist.com/graphic-detail/2019/06/04/the-world-according-to-donald-trump&#xD;
  [4]: http://www.wolfram.com/events/technology-conference/2019/&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1000.12.59.png&amp;amp;userId=48754&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1000.27.41.png&amp;amp;userId=48754&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1000.34.11.png&amp;amp;userId=48754&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1000.41.34.png&amp;amp;userId=48754&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1000.43.14.png&amp;amp;userId=48754&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1000.45.38.png&amp;amp;userId=48754&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1001.24.25.png&amp;amp;userId=48754&#xD;
  [12]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1000.53.33.png&amp;amp;userId=48754&#xD;
  [13]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1000.55.22.png&amp;amp;userId=48754&#xD;
  [14]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1001.05.39.png&amp;amp;userId=48754&#xD;
  [15]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1001.07.12.png&amp;amp;userId=48754&#xD;
  [16]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1001.08.07.png&amp;amp;userId=48754&#xD;
  [17]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1001.09.33.png&amp;amp;userId=48754&#xD;
  [18]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1001.12.15.png&amp;amp;userId=48754&#xD;
  [19]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1001.13.26.png&amp;amp;userId=48754&#xD;
  [20]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1001.14.50.png&amp;amp;userId=48754&#xD;
  [21]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2019-07-1001.33.04.png&amp;amp;userId=48754</description>
    <dc:creator>Marco Thiel</dc:creator>
    <dc:date>2019-07-10T00:40:42Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/932548">
    <title>Beyond Four Corners, USA</title>
    <link>https://community.wolfram.com/groups/-/m/t/932548</link>
    <description>#Introduction&#xD;
I recently saw a TV show set at Four Corners USA, the point where Utah, Colorado, Arizona, and New Mexico meet:&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
It made me wonder how frequent 4 or more geographical borders meet at one point. According to [Wikipedia][2], 4 borders meeting at a point is called a ***quadripoint***, 5 borders meeting is called a ***quintipoint***, and in general it&amp;#039;s called a ***multipoint***. The entry only lists one quintipoint and goes on to say&#xD;
&#xD;
&amp;gt; Perhaps a dozen quintipoints of various levels of geopolitical subdivisions are scattered around the world;&#xD;
&#xD;
This piqued my interest to find all multipoints, using the Wolfram Language.&#xD;
&#xD;
--------&#xD;
#Results&#xD;
&#xD;
Before I give the details on how to detect multipoints, I&amp;#039;d like to showcase the results.&#xD;
&#xD;
###Summary&#xD;
 - Since borders are not always precise (or even well defined at times), I allowed for an error up to ~100 meters when classifying points.&#xD;
 - The polygons were obtained from the `&amp;#034;Country&amp;#034;` and `&amp;#034;AdministrativeDivision&amp;#034;` `Entity` types (about 40,000 in total).&#xD;
 - There are a total of **724 quadripoints** in this dataset.&#xD;
 - There are a total of **13 quintipoints** in this dataset.&#xD;
 - There is **1 *10-point*** in this dataset!&#xD;
 - There are **only 6 multipoints** in the dataset whose regions *don&amp;#039;t* share the same parent region.&#xD;
&#xD;
###Quadripoints&#xD;
With **724 quadripoints**, there are too many to list here, but here are a few interesting ones.&#xD;
&#xD;
 - The only countries to form a quadripoint are **Namibia, Botswana, Zambia, and Zimbabwe**.&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
 - There are a considerable amount of **counties in Iowa and Texas** that are apart of multiple quadripoints, i.e. more than one corner is a quadripoint. This is because they are roughly arranged in a rectangular grid.&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
 - There were only 6 quadripoints found whose parent regions differ:&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
 - Here&amp;#039;s a visual summary of all quadripoints found (note the level 3 regions were heavily thickened to become visible):&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
###Quintipoints&#xD;
Here are all **13 quintipoints** found:&#xD;
&#xD;
 - **Saint Kitts and Nevis**: Saint George Gingerland - Saint James Windward - Saint John Figtree - Saint Paul Charlestown - Saint Thomas Lowland&#xD;
 - **Boyaca, Colombia**: Chinavita - Garagoa - Miraflores - Ramiriquí - Zetaquirá&#xD;
 - **Counties in Florida, USA**: Glades - Hendry - Martin - Okeechobee - Palm Beach&#xD;
 - **Usulutan, El Salvador**: California - Ozatlán - Santa Elena - Tecapán - Usulután&#xD;
 - **Arequipa, Arequipa, Peru**: Alto Selva Alegre - Cayma - Chiguata - Miraflores - San Juan de Tarucani&#xD;
 - **Cuenca, Azuay, Ecuador**: Chiquintad - Cuenca - Ricaurte - Sidcay - Sinicay&#xD;
 - **Pea Reang, Prey Vêng, Cambodia**: Kampong Popil - Mesa Prachan - Prey Sralet - Reab - Roka&#xD;
 - **Rieti, Lazio, Italy**: Borgo Velino - Castel Sant&amp;#039; Angelo - Cittaducale - Micigliano - Rieti&#xD;
 - **Cosenza, Calabria, Italy**: Marano Marchesato - Marano Principato - Rende - San Fili - San Lucido&#xD;
 - **Napoli, Campania, Italy**: Boscotrecase - Ercolano - Ottaviano - Torre Del Greco - Trecase&#xD;
 - **Savona, Liguria, Italy**: Bardineto - Boissano - Giustenice - Loano - Pietra Ligure&#xD;
 - **Torino, Piemonte, Italy**: Cuceglio - Mercenasco - Montalenghe - Scarmagno - Vialfrè&#xD;
 - **Viterbo, Lazio, Italy**: Bolsena - Capodimonte - Gradoli - Montefiascone - San Lorenzo Nuovo&#xD;
&#xD;
As you can see, Italy takes the cake with 6 quintipoints! Here&amp;#039;s a visual of these quintipoints, along with the error allowing them to be classified as such:&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
###A Near 6-point&#xD;
Notice in the top right map above, it looks like there is room for one more region in Viterbo, Lazio, Italy, which would make it a 6-point. Here&amp;#039;s the 6th region (Grotte Di Castro) in black:&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
It turns out Grotte Di Castro is about 700 meters from the quintipoint, making this only a ***near* 6-point**:&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
###10-point&#xD;
As mentioned in the [Wikipedia entry][10], there is a 10-point in Italy at the summit of [Mount Etna][11]:&#xD;
&#xD;
 - **Catania, Sicily, Italy**: Adrano - Belpasso - Biancavilla - Bronte - Castiglione Di Sicilia - Maletto - Nicolosi - Randazzo - Sant&amp;#039; Alfio - Zafferana Etnea&#xD;
&#xD;
![enter image description here][12]&#xD;
&#xD;
###Allowing for more error&#xD;
If we allow for more error, we can find ***near-multipoints*** - regions that almost have a multipoint, but clearly don&amp;#039;t. For example, there is a near-quintipoint in Texas, USA:&#xD;
&#xD;
![enter image description here][13]&#xD;
&#xD;
--------&#xD;
#Code&#xD;
The idea to find multipoints within a collection of regions is as follows:&#xD;
&#xD;
 1. Obtain the `Polygon` for each region.&#xD;
 2. For each pair of regions, if there&amp;#039;s a vertex from one of the polygons which is &amp;#034;close&amp;#034; to the other, mark these regions as touching. `RegionDistance` can be used for this.&#xD;
 3. The relation of touching between pairs forms an adjacency matrix. From this, form a `Graph` and use `FindClique` to find all multipoints in this collection.&#xD;
&#xD;
Here is code that does just that:&#xD;
&#xD;
    discretize[Polygon[pts_?MatrixQ]] := &#xD;
        MeshRegion[pts, Polygon[Range[Length[pts]]]]&#xD;
    discretize[Polygon[pts_?(VectorQ[#, MatrixQ] &amp;amp;)]] :=&#xD;
      With[{pts2 = Select[pts, Length[#] &amp;gt; 2 &amp;amp;]},&#xD;
        MeshRegion[Join @@ pts2, &#xD;
          Polygon[Range[# + 1, #2] &amp;amp; @@@ Partition[Prepend[Accumulate[Map[Length, pts2]], 0], 2, 1]]]&#xD;
      ]&#xD;
    discretize[expr_] :=&#xD;
      With[{mr = DiscretizeGraphics[Graphics[expr]]},&#xD;
        mr /; MeshRegionQ[mr]&#xD;
      ]&#xD;
    discretize[_] = $Failed;&#xD;
&#xD;
    polyLookup = discretize /@ (Join[&#xD;
      EntityValue[&amp;#034;Country&amp;#034;, &amp;#034;Polygon&amp;#034;, &amp;#034;EntityAssociation&amp;#034;],&#xD;
      EntityValue[&amp;#034;AdministrativeDivision&amp;#034;, &amp;#034;Polygon&amp;#034;, &amp;#034;EntityAssociation&amp;#034;]&#xD;
    ] /. GeoPosition -&amp;gt; Identity);&#xD;
&#xD;
    MultiPoints[divs_List, n_] /; Length[divs] &amp;lt; n = {};&#xD;
    &#xD;
    MultiPoints[divs_List, n_] :=&#xD;
    	Block[{polys, disj, cands},&#xD;
    		polys = polyLookup /@ divs;&#xD;
    		(&#xD;
    			disj = Boole[Outer[CoordinateNear, polys, polys]] - IdentityMatrix[Length[divs]];&#xD;
    			(&#xD;
    				cands = FindClique[AdjacencyGraph[divs, disj], {n, Infinity}, All];&#xD;
    				&#xD;
    				resolveMultiPoints[cands, AssociationThread[divs, polys]]&#xD;
    				&#xD;
    			) /; MatrixQ[disj, IntegerQ]&#xD;
    			&#xD;
    		) /; VectorQ[polys, MeshRegionQ]&#xD;
    	]&#xD;
    MultiPoints[___] = {};&#xD;
    &#xD;
    $tol = 0.001;&#xD;
    CoordinateNear[mr1_, mr2_, tol_:$tol] :=&#xD;
    	With[{d = {{-tol, tol}, {-tol, tol}}},&#xD;
    		And[&#xD;
    			NoneTrue[Transpose[{d+RegionBounds[mr1], d+RegionBounds[mr2]}], #1[[2,1]] &amp;gt; #1[[1,2]] || #1[[1,1]] &amp;gt; #1[[2,2]]&amp;amp;],&#xD;
    			Min[RegionDistance[mr1, MeshCoordinates[mr2]]] &amp;lt; tol&#xD;
    		]&#xD;
    	]&#xD;
    &#xD;
    resolveMultiPoints[{}, _] = {};&#xD;
    resolveMultiPoints[cands_List, passoc_?AssociationQ] :=&#xD;
    	Select[cands, MultiPointQ[#, passoc]&amp;amp;]&#xD;
    &#xD;
    MultiPointQ[cands_, passoc_?AssociationQ, tol_:$tol] :=&#xD;
    	Block[{coords, mrs},&#xD;
    		mrs = passoc /@ cands;&#xD;
    		coords = Union @@ MeshCoordinates /@ mrs;&#xD;
    		&#xD;
    		Or @@ Thread[And @@ (Thread[RegionDistance[#, coords] &amp;lt; tol]&amp;amp; /@ mrs)]&#xD;
    	]&#xD;
Now here&amp;#039;s all multipoints formed from countries:&#xD;
&#xD;
![enter image description here][14]&#xD;
&#xD;
Now to explore all cases, we can start off by looking for multipoints in all subdivisions of a given region, e.g. given Florida, find all multipoints within the counties of Florida. This can be achieved by building a hierarchical graph connecting countries and administrative divisions. Then for a given region, this graph can be used to find all subdivisions and the above code can be used to find the multipoints.&#xD;
&#xD;
    ad = AdministrativeDivisionData[];&#xD;
    pr = EntityValue[&amp;#034;AdministrativeDivision&amp;#034;, &amp;#034;ParentRegion&amp;#034;];&#xD;
    &#xD;
    $ADNetwork = Graph[Join[&#xD;
        Thread[&amp;#034;NullPointer&amp;#034; -&amp;gt; EntityList[&amp;#034;Country&amp;#034;]],&#xD;
        DeleteCases[Thread[pr -&amp;gt; ad], Rule[_Missing, _]]&#xD;
    ]];&#xD;
    &#xD;
    ChildrenMultiPoints[reg_] := ChildrenMultiPoints[reg, 4]&#xD;
&#xD;
    ChildrenMultiPoints[reg_, o___] :=&#xD;
    	MultiPoints[Rest[VertexOutComponent[$ADNetwork, reg, 1]], o]&#xD;
&#xD;
![enter image description here][15]&#xD;
&#xD;
Lastly, to cover all cases we need to consider sets of regions that have differing parent regions. To do this, for a given parent region $P$, first find all other regions $R_i$ (on the same level) that touch this region. Then simply run `MultiPoints` on all subdivisions in $P \cup R_i$. I omit this code here, as there were only 6 instances that came out of this case.&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=7535fourcorners.png&amp;amp;userId=46025&#xD;
  [2]: https://en.wikipedia.org/wiki/Quadripoint&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=countryquadripoint.png&amp;amp;userId=46025&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=2008squarequadripoints.png&amp;amp;userId=46025&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=crossregionquadripoints.png&amp;amp;userId=46025&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=allquadripoints.png&amp;amp;userId=46025&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=4697quintipoints.png&amp;amp;userId=46025&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=8873almostsixpoint.png&amp;amp;userId=46025&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=9086almostsixpointzoom.png&amp;amp;userId=46025&#xD;
  [10]: https://en.wikipedia.org/wiki/Quadripoint#Multipoints_of_greater_numerical_complexity&#xD;
  [11]: https://en.wikipedia.org/wiki/Mount_Etna#Geopolitical_oddity&#xD;
  [12]: http://community.wolfram.com//c/portal/getImageAttachment?filename=3719tenpoint.png&amp;amp;userId=46025&#xD;
  [13]: http://community.wolfram.com//c/portal/getImageAttachment?filename=4645almostquintpoint.png&amp;amp;userId=46025&#xD;
  [14]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2016-10-0117.18.37.png&amp;amp;userId=46025&#xD;
  [15]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2016-10-0117.27.16.png&amp;amp;userId=46025</description>
    <dc:creator>Greg Hurst</dc:creator>
    <dc:date>2016-10-01T22:56:22Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2135869">
    <title>Tilings and constraint programming</title>
    <link>https://community.wolfram.com/groups/-/m/t/2135869</link>
    <description>Introduction&#xD;
------------&#xD;
&#xD;
The goal of this post is to start from images like this example one :&#xD;
&#xD;
![Girl3][1]&#xD;
&#xD;
and generate pictures like:&#xD;
&#xD;
![Girl3Gray][2]&#xD;
&#xD;
or&#xD;
&#xD;
![Girl3Color][3]&#xD;
&#xD;
Mathematica at least 12.1 will be required since Mixed Integer programming is used.&#xD;
&#xD;
Explanation&#xD;
-----------&#xD;
&#xD;
 &#xD;
&#xD;
Let&amp;#039;s take the first image (black and white) as an example.&#xD;
&#xD;
Let&amp;#039;s assume we have a collection of 16 tiles:&#xD;
&#xD;
![GrayTiles][4]&#xD;
&#xD;
The problem to solve is how to place the tiles on the picture so that the gray content of a tile is close to the gray content of the picture below it and at the same time the topological constraints are satisfied.&#xD;
&#xD;
By topological constraints, I mean that the tiles must be compatible.&#xD;
&#xD;
This is allowed:&#xD;
&#xD;
![Allowed][5]&#xD;
&#xD;
This is forbidden because the dark horizontal band is continuing as a white horizontal band.&#xD;
&#xD;
![Forbidden][6]&#xD;
&#xD;
We are going to translate this problem into a set of equations on integer variables and with a linear cost function to optimize. The final problem will be solved with the LinearOptimization function from Mathematica 12.1.&#xD;
&#xD;
Each pixel of the image is encoded by a vector ![eq1][7] because there are 16 different tiles in this example. The components of the vector can be either 0 or 1.&#xD;
&#xD;
This is expressed as:&#xD;
&#xD;
    VectorLessEqual[{0, v}], VectorLessEqual[{v, 1}], v \[Element] Vectors[nbTiles, Integers]&#xD;
&#xD;
For each pixel, only one tile can be used. We cannot put several tiles on a pixel but only choose one and only one.&#xD;
&#xD;
If we use the constraint:&#xD;
&#xD;
![eq2][8]&#xD;
&#xD;
then we express that only one tile can be used. Indeed, since the component are integers and equal to 0 or 1, then the only way to satisfy this equation is that one of the components, and only one, is equal to one.&#xD;
&#xD;
Expressing the topological constraints is similar.&#xD;
&#xD;
We have equations like:&#xD;
&#xD;
![eq3][9]&#xD;
&#xD;
This equation is describing a relationship between pixel (x,y) and pixel (x+1,y).&#xD;
&#xD;
The values on left and right side can either be 0 or 1 (at same time). When zero it means : none of the tiles is used. When one, it means one of the tile is used. So, the translation of the equation is:&#xD;
&#xD;
If the tile 0,3 or 5 are used at pixel (x,y) then the tiles 3,6,9 or 11 must be used at pixel (x+1,y).&#xD;
&#xD;
(I have not checked if it makes sense with the set of tiles I am using as example. The constraints for those tiles are probably different.).&#xD;
&#xD;
&#xD;
To describe the topological constraint of the tiles, we have functions like:&#xD;
&#xD;
    rightSide[tileA[{a_,b_,c_}]] :={b,c};&#xD;
&#xD;
This is  giving a key describing the right side of the tile. Those keys are then used in associations to build the topological constraints. The key can be anything so if you want to add new tiles, you can just use the key you want to describe the sides of your tiles.&#xD;
&#xD;
The generic function rightSide must be extended with new cases when new tiles are added.&#xD;
&#xD;
Then, we need to express how good the tiles are approximating the original picture.&#xD;
&#xD;
For this, an error function is created. It is a sum of terms:&#xD;
&#xD;
![eq4][10]&#xD;
&#xD;
It means that if the tile i is selected for pixel (x,y) then the approximation error is `Subscript[f, k]`&#xD;
&#xD;
The function averageColor must be extended with new tiles. It returns the color content of a tile : a RGBColor. The code is using a color distance to compute the errors.&#xD;
&#xD;
That&amp;#039;s why the input picture is always converted to RGB and the alpha channel removed.&#xD;
&#xD;
So, finally we have translated our problem into a set of integer constraints and with a linear cost function to optimize. It is a mixed integer programming problem which can be solved with LinearOptimization.&#xD;
&#xD;
The tiles must be displayed. It is done by the function tileDraw and the tile is drawn in a square from (0,0) to (1,1) corners.&#xD;
The code is rasterizing those graphics into 50x50 pixel images.&#xD;
&#xD;
I have had lots of problems with those pictures due to rounding errors ... probably due to the very old GPU on my very old computer.&#xD;
So I tuned the vector code assuming the final tile image is 50x50 pixels. Now the pictures are well aligned, there is no more one row or one column of wrong pixels on the boundary of the tiles.&#xD;
&#xD;
But this may cause a problem on your configuration. So, if the tile pictures are not rendering correctly on your side, you&amp;#039;ll need to tune my vector graphic code again.&#xD;
&#xD;
If the picture is too big, solving the full mixed integer programming problem may take too long. But we can solve a sub-optimal problem. We divide the picture into sub-pictures and solve the problem on each sub-picture then we recombine the solutions. For it to work : we must add new constraints to express compatibility between the pictures.&#xD;
&#xD;
For instance, the left side of a picture at (row,col) must be compatible with the right side of the picture at (row,col-1). So, the problem must be solved in a given order so that the constraints can be propagated from one sub-picture to the other.&#xD;
&#xD;
For some tiles, the sub-optimal solution can be very good from an artistic point of view (the dark tiles below are working well). For other tiles (the smith tiles in the notebook) either the sub-optimal problem cannot always be solved (because the constraints coming from the previous pictures can&amp;#039;t be satisfied) or the sub-optimal problem will look bad from time to time.&#xD;
&#xD;
So this idea of using sub-picture is really dependent on the kind of tiles used. You need to experiment. But it is art after all.&#xD;
&#xD;
Example of use&#xD;
--------------&#xD;
&#xD;
First, we get an example picture:&#xD;
&#xD;
    srcImage = ImageCrop[ExampleData[{&amp;#034;TestImage&amp;#034;, &amp;#034;Girl3&amp;#034;}], {190, 270}]&#xD;
&#xD;
The picture is resized, converted to RGB and any alpha channel removed.&#xD;
&#xD;
    imgToAnalyze = &#xD;
     ImageResize[&#xD;
      ImageAdjust[&#xD;
       RemoveAlphaChannel[ColorConvert[srcImage, &amp;#034;RGB&amp;#034;], Black]], {50, &#xD;
       Automatic}]&#xD;
&#xD;
For the dark tiles (knots), we decide to only use gray levels. First color is the background of the tiles. Other colors are for the circles and vertical and horizontal bands.&#xD;
&#xD;
    tileData = &#xD;
      mkDarkTiles[RGBColor[&#xD;
       0.5, 0.5, 0.5], {RGBColor[0., 0., 0.], RGBColor[1., 1., 1.]}];&#xD;
&#xD;
It gives a total of 16 tiles. The more tiles, the more difficult it is to solve the problem. 16 is ok on my old computer.&#xD;
&#xD;
    tileData[&amp;#034;allTilesImg&amp;#034;] // Length&#xD;
&#xD;
The problem is solved on 15x15 sub pictures.&#xD;
&#xD;
    solution = partitionSolve[tileData, imgToAnalyze, 15];&#xD;
&#xD;
The final picture is generated from the tiles and the solution.&#xD;
&#xD;
    img = createPict[tileData, solution];&#xD;
&#xD;
And you&amp;#039;ll get:&#xD;
&#xD;
![Girl3Gray][2]&#xD;
&#xD;
Have fun ! I hope the vectorial code will not have to be tuned to generate the tile pictures (rounding errors).&#xD;
&#xD;
The notebook is attached to the post.&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Girl3.png&amp;amp;userId=89693&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Girl3Gray.png&amp;amp;userId=89693&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Girl3Color.png&amp;amp;userId=89693&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Tiles.png&amp;amp;userId=89693&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Allowed.png&amp;amp;userId=89693&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Forbidden.png&amp;amp;userId=89693&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=eq1.png&amp;amp;userId=89693&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=eq2.png&amp;amp;userId=89693&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=eq3.png&amp;amp;userId=89693&#xD;
  [10]: https://community.wolfram.com//c/portal/getImageAttachment?filename=eq4.png&amp;amp;userId=89693&#xD;
  [11]: https://community.wolfram.com//c/portal/getImageAttachment?filename=LenaGray.png&amp;amp;userId=89693</description>
    <dc:creator>Christophe Favergeon</dc:creator>
    <dc:date>2020-12-11T16:08:18Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2626487">
    <title>Palindromes, reduplication, and more</title>
    <link>https://community.wolfram.com/groups/-/m/t/2626487</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/fc6be98d-cddb-4a63-a091-b712c48b7758</description>
    <dc:creator>Chase Marangu</dc:creator>
    <dc:date>2022-09-30T04:50:44Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/566363">
    <title>Analytics of Republican Debate and network percolation</title>
    <link>https://community.wolfram.com/groups/-/m/t/566363</link>
    <description>[Alan Joyce][1] sent me some neat code of analysis of Republican Debate Sep. 16, 2015. **Please do see his analytics below**. Transcripts of debate can be found online. Alan mined most popular words used by the candidates filtered and re-weighted by different criteria. Properly weighted [WordClouds][2] are a good way to grasp key topics.&#xD;
&#xD;
I just wanted to point to graph &amp;amp; networks take on the data. I thought that some candidates may share some top words they use. So if the candidates are nodes, then a weighted edge between them reflects upon how many top words they share. If you consider 1 top word per candidate then the graph will be completely disconnected as each candidate has own unique single top word. As you increase top words&amp;#039; pool some of them will be common and shared between some candidates and links between nodes will appear. &#xD;
&#xD;
Percolation is the moment when, driven by top-words pool-size, all candidates become connected. In the opposite limit of large pool-size all candidates are connected and we get a complete graph. So below is the percolation moment that happens at 5 top words per candidate. **It is indicative of which candidates speak about top common subjects.** &#xD;
&#xD;
    CommunityGraphPlot[HighlightGraph[SetProperty[g, EdgeLabels -&amp;gt; None], Table[Style[e, Opacity[.7], &#xD;
        Thickness[.005 PropertyValue[{g, e}, EdgeWeight]]], {e, EdgeList[g]}]], &#xD;
     CommunityBoundaryStyle -&amp;gt; Directive[Red, Dashed, Thick], &#xD;
     CommunityRegionStyle -&amp;gt; {Directive[Opacity[.1], Red], &#xD;
       Directive[Opacity[.1], Yellow], Directive[Opacity[.1], Blue]}]&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
The edge thickness is reflective of number of common words. Grouping shows clustering of candidates around common words. And vertex size come from DegreeCentrality. DegreeCentrality will give high centralities to vertices that have high vertex degrees. So candidates with top words similar to more other candidates will have larger vertices. Clustered CommunityGraphPlot was derived from the top words:&#xD;
&#xD;
    topWords = Sort[Normal[highFrequencyForCloud[#]], #1[[2]] &amp;gt; #2[[2]] &amp;amp;][[;; 5]][[All, 1]] &amp;amp; /@ candidates;&#xD;
    TableForm[topWords, TableHeadings -&amp;gt; {candidates, None}]&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
( refining text filters would narrow top words more precisely ) and WeightedAdjacencyGraph:&#xD;
&#xD;
    mocw = Outer[Length[Intersection[#1, #2]] &amp;amp;, topWords, topWords, 1] (1 - IdentityMatrix[10]) /. 0 -&amp;gt; Infinity;&#xD;
    mocw // MatrixForm&#xD;
&#xD;
    g = WeightedAdjacencyGraph[candidates, mocw, VertexLabels -&amp;gt; &amp;#034;Name&amp;#034;, &#xD;
      EdgeLabels -&amp;gt; &amp;#034;EdgeWeight&amp;#034;,EdgeLabelStyle -&amp;gt; 15, VertexLabelStyle -&amp;gt; 14, &#xD;
      VertexSize -&amp;gt; &amp;#034;DegreeCentrality&amp;#034;, GraphStyle -&amp;gt; &amp;#034;ThickEdge&amp;#034;, &#xD;
      GraphLayout -&amp;gt; &amp;#034;CircularEmbedding&amp;#034;, VertexStyle -&amp;gt; Directive[Opacity[.8], Orange]]&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
For top words extraction and better refinement see Alan&amp;#039;s analysis right below. The notebook is attached to his post.&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com/web/alanj&#xD;
  [2]: http://reference.wolfram.com/language/ref/WordCloud.html&#xD;
  [3]: /c/portal/getImageAttachment?filename=qe345yrehgfsge354y6thrgfdasd.png&amp;amp;userId=11733&#xD;
  [4]: /c/portal/getImageAttachment?filename=2015-09-18_03-16-06.png&amp;amp;userId=11733&#xD;
  [5]: /c/portal/getImageAttachment?filename=ScreenShot2015-09-18at3.17.04AM.png&amp;amp;userId=11733&#xD;
  [6]: /c/portal/getImageAttachment?filename=sdaft546ejytrgearwrqtwrhsbgfdasv.png&amp;amp;userId=11733</description>
    <dc:creator>Vitaliy Kaurov</dc:creator>
    <dc:date>2015-09-17T22:19:15Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2542490">
    <title>Imaging a rotating disk with a rolling shutter</title>
    <link>https://community.wolfram.com/groups/-/m/t/2542490</link>
    <description>![enter image description here][1]&#xD;
&#xD;
The excellent [community contribution][2] by [@Greg Hurst][at0] and a Wikipedia [animation][3], Inspired me to look further into this &amp;#034;rolling shutter effect on rotating objects&amp;#034;. &#xD;
When we capture a video of a rotating disk with a rolling shutter, we have two independent movements: the colored disk rotating at *rps revolutions per second* and the shutter line sweeping one frame at *fps frames per second*. The ratio rps/fps is the driver of the rolling shutter effect (or the disk rps alone if we normalize the shutter fps to 1 frame per second).  In order to best demonstrate this effect, ratios of rps/fps are taken to be in the range 1.5-2.5&#xD;
&#xD;
This is a colored disk of m pixels wide, rotated over an angle theta.&#xD;
&#xD;
    colors = {RGBColor[1, 0, 1], RGBColor[0.988, 0.73, 0.0195], RGBColor[&#xD;
       0.266, 0.516, 0.9576], RGBColor[0.207, 0.652, 0.324], RGBColor[&#xD;
       0, 0, 1], RGBColor[1, 0, 0]};&#xD;
    colorDisk[theta_, m_, cols_] := &#xD;
     ImageResize[&#xD;
      Image[Graphics[&#xD;
        MapThread[{#3, &#xD;
           Disk[{0, 0}, 1, {#1, #2} + theta]} &amp;amp;, {Pi Range[0, 5, 1]/3, &#xD;
          Pi Range[1, 6]/3, colors}]]], m]&#xD;
&#xD;
A video of the rotating disk consists of a series of frames. Each frame is captured during one passage of the shutter line. The function *angularPosition* links the angular progress of the disk to the frame number (frm) and the row number at the position of the shutter line:&#xD;
&#xD;
    angularPosition[frm_, row_, rps_, &#xD;
      m_] := -2 Pi (-1 + (-1 + frm) m + row) rps/m&#xD;
&#xD;
Th function *diskFrameImage* computes the result of the shutter line swiping a colored disk (of size m, rotating at rps revolutions per second) at frame number frm and up to row number toRow:&#xD;
&#xD;
    diskFrameImage[frm_, toRow_, rps_, m_, cols_] := &#xD;
     ImageAssemble[&#xD;
      Transpose@{ParallelTable[&#xD;
         ImageTake[&#xD;
          colorDisk[angularPosition[frm, r, rps, m], m, colors], {r}], {r,&#xD;
           toRow}]}]&#xD;
&#xD;
This is the first frame of a video of a disk rotating at a speed ratio rps/fps of 1 : &#xD;
&#xD;
    With[{m = 200, frm = 1, rps = 1}, &#xD;
     diskFrameImage[frm, m, rps, m, colors]]&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
This shows the influence of the disk rps/fps ratio on the appearance of the first frame  captured: &#xD;
&#xD;
    With[{m = 200, frm = 1}, &#xD;
     Grid[{{&amp;#034;rps=0.512&amp;#034;, &amp;#034;rps=1.512&amp;#034;, &amp;#034;rps=2.512&amp;#034;}, &#xD;
       diskFrameImage[frm, m, #, m, colors] &amp;amp; /@ {.512, 1.512, 2.512}}]]&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
Below is a GIF showing the capture of the first frame of a disk rotating at rps/fps 1. The code is used to generate all of the following GIFs.&#xD;
&#xD;
    With[{m = 200, frm = 1, rps = 1.},&#xD;
     Animate[&#xD;
      Grid[{{&#xD;
         ImageCompose[&#xD;
          colorDisk[angularPosition[frm, row, rps, m], m, colors], &#xD;
          Graphics[Line[{{-m, 0}, {m, 0}}]], Scaled[{.5, (m - row)/m}]],&#xD;
         ImageCompose[diskFrameImage[frm, row, rps, m, colors], &#xD;
          Graphics[Line[{{-m, 0}, {m, 0}}]], Scaled[{.5, .01}]]}}, &#xD;
       Alignment -&amp;gt; Top], {row, 1, m}]]&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
Below are 4 examples showing the capture of the first frame of a video of a rotating disk with a roller shutter at 1fs. The disk rotates at 0.5 rps (top left), 1.0 rps (top right), 1.5 rps (bottom left) and 2.0 rps (bottom right). As the disk rotates faster relative to the shutter, the captured image becomes more complex.&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
The subsequent frames are captured the same way. Below are the first 5 frames of a video of a disk rotating at 1.5123 rps:&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
There ought to be a lot more images that result from the transformation of a rotation into a capture with a rolling shutter. I hope this contribution can inspire more community members.&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=combirotodisk15and2.gif&amp;amp;userId=20103&#xD;
  [2]: https://community.wolfram.com/groups/-/m/t/2489445&#xD;
  [3]: https://upload.wikimedia.org/wikipedia/commons/1/15/Rolling_shutter_effect_animation.gif&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=8345locusfulldiskrps1.png&amp;amp;userId=68637&#xD;
  [5]: https://community.wolfram.com//c/portal/getImageAttachment?filename=9528colordiskrpscompare.png&amp;amp;userId=68637&#xD;
  [6]: https://community.wolfram.com//c/portal/getImageAttachment?filename=newrotodiskfrm1rps05small.gif&amp;amp;userId=68637&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=combirotodisk05and10.gif&amp;amp;userId=68637&#xD;
  [8]: https://community.wolfram.com//c/portal/getImageAttachment?filename=combirotodisk15and2.gif&amp;amp;userId=68637&#xD;
  [9]: https://community.wolfram.com//c/portal/getImageAttachment?filename=allframesvideofinal.gif&amp;amp;userId=68637&#xD;
&#xD;
 [at0]: https://community.wolfram.com/web/ghurst</description>
    <dc:creator>Erik Mahieu</dc:creator>
    <dc:date>2022-06-02T12:22:57Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2316573">
    <title>[WSC21] Building isolation and average shape analysis with image processing</title>
    <link>https://community.wolfram.com/groups/-/m/t/2316573</link>
    <description>![enter image description here][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=image%281%29.png&amp;amp;userId=2316532&#xD;
  [2]: https://www.wolframcloud.com/obj/b413a444-3a6d-4675-8984-99255ca6959e</description>
    <dc:creator>Sidharth Jain</dc:creator>
    <dc:date>2021-07-15T18:30:57Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2858759">
    <title>Hat tilings via HTPF equivalence</title>
    <link>https://community.wolfram.com/groups/-/m/t/2858759</link>
    <description>![enter image description here][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=HattilingsviaHTPFequivalence.png&amp;amp;userId=20103&#xD;
  [2]: https://www.wolframcloud.com/obj/8834ec94-ab97-4b06-9446-1654c806e062</description>
    <dc:creator>Brad Klee</dc:creator>
    <dc:date>2023-03-24T23:19:15Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2516662">
    <title>Re-exploring the structure of Chinese character images</title>
    <link>https://community.wolfram.com/groups/-/m/t/2516662</link>
    <description>&amp;amp;[Wolfram Notebook][1]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolframcloud.com/obj/afc17dcc-20ac-4990-a933-02fed606f0af</description>
    <dc:creator>Anton Antonov</dc:creator>
    <dc:date>2022-04-22T17:14:10Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1732586">
    <title>[WSC19] Mood Detection in Human Speech</title>
    <link>https://community.wolfram.com/groups/-/m/t/1732586</link>
    <description>![Feature Space Plot for speech data][1]&#xD;
&#xD;
### *Figure Above: Feature Space Plot for speech data*&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
## Abstract&#xD;
In this project, I aim to design a system which is capable of detecting mood in human speech. Specifically, the system can be trained on a single user&amp;#039;s voice given samples of emotional speech labeled as being angry, happy, or sad. The system is then able to classify future audio clips of the user&amp;#039;s speech as having one of these three moods. I collected voice samples of myself and trained a Classifier Function based on this data. I experimented with many different available methods for the Classifier Function and for audio preprocessing to obtain the most accurate Classifier.&#xD;
&#xD;
## Obtaining Data&#xD;
In this project, I focused on detecting mood for only one user (specifically, myself) since different people may express mood in different ways, leading to confusion for the Classifier. I initially recorded ten speech clips in each mood as training data, and ten different clips in each mood as testing data. I used [Audacity](https://www.audacityteam.org/) to record audio clips in 32-bit floating point resolution, exported as WAV files. If you&amp;#039;re looking to replicate this project, you can use your own data, or use mine, available on [my GitHub repository](https://github.com/vedadehhc/MoodDetector). I later recorded additional clips, as discussed below.&#xD;
&#xD;
## Feature Extraction&#xD;
In order to produce the most accurate Classifier, I extracted features which I thought were most useful to detecting mood. Specifically, I extracted the amplitudes, fundamental frequencies, and formant frequencies of each clip over the length of the clip using [AudioLocalMeasurements](https://reference.wolfram.com/language/ref/AudioLocalMeasurements.html). That is, I took multiple measurements of each of these values, over many partitions of the clip. I partitioned each clip into 75 parts, but feel free to experiment with different values. I also found the word rate, using Wolfram Language&amp;#039;s experimental [SpeechRecognize](https://reference.wolfram.com/language/ref/SpeechRecognize.html) function, and the ratio of pausing time to total time of the clip using [AudioIntervals](https://reference.wolfram.com/language/ref/AudioIntervals.html). The final function takes the location of the audio file (could be local or on the web) and the number of partitions, and returns an association with the extracted features. It&amp;#039;s important that the function return an association, since this makes things much easier when constructing the Classifier Function. The initial function for feature extraction is included below.&#xD;
&#xD;
    extractFeatures[fileLocation_, parts_] :=  &#xD;
     Module[{audio, assoc, pdur, amp, freq, form}, &#xD;
      audio = Import[fileLocation];&#xD;
      pdur = AudioMeasurements[audio, &amp;#034;Duration&amp;#034;]/parts;&#xD;
      amp = AudioLocalMeasurements[audio, &amp;#034;RMSAmplitude&amp;#034;, &#xD;
         PartitionGranularity -&amp;gt; pdur] // Normal;&#xD;
      freq = AudioLocalMeasurements[audio, &amp;#034;FundamentalFrequency&amp;#034;, &#xD;
         MissingDataMethod -&amp;gt; {&amp;#034;Interpolation&amp;#034;, InterpolationOrder -&amp;gt; 1}, &#xD;
         PartitionGranularity -&amp;gt; pdur] // Normal;&#xD;
      form =  &#xD;
       AudioLocalMeasurements[audio, &amp;#034;Formants&amp;#034;, &#xD;
         PartitionGranularity -&amp;gt; pdur] // Normal;&#xD;
      assoc = &amp;lt;|&#xD;
        Table[&amp;#034;amplitude&amp;#034; &amp;lt;&amp;gt; ToString[i] -&amp;gt; amp[[i]][[2]], {i, Length[amp]}], &#xD;
        Table[&amp;#034;frequency&amp;#034; &amp;lt;&amp;gt; ToString[i] -&amp;gt; freq[[i]][[2]], {i, Length[freq]}], &#xD;
        &amp;#034;wordrate&amp;#034; -&amp;gt; &#xD;
          Length[TextWords[Quiet[SpeechRecognize[audio]]]]/&#xD;
          AudioMeasurements[audio, &amp;#034;Duration&amp;#034;],&#xD;
        Table[Table[&amp;#034;formant&amp;#034; &amp;lt;&amp;gt; ToString[i] &amp;lt;&amp;gt; &amp;#034;-&amp;#034; &amp;lt;&amp;gt; ToString[j] -&amp;gt;&#xD;
          form[[i]][[j]], {j, Length[form[[i]]]}], {i, Length[form]}],&#xD;
        &amp;#034;pauses&amp;#034; -&amp;gt;  &#xD;
          Total[Abs /@ Subtract @@@ AudioIntervals[audio, &amp;#034;Quiet&amp;#034;]]/&#xD;
          AudioMeasurements[audio, &amp;#034;Duration&amp;#034;]&#xD;
        |&amp;gt;; &#xD;
      Map[Normal, assoc, {1}]&#xD;
    ]&#xD;
&#xD;
### Get Training Data&#xD;
Using this function, I was able get the features for all of my training data. Here, I&amp;#039;ll import my data from [my GitHub repository](https://github.com/vedadehhc/MoodDetector).&#xD;
&#xD;
    angryTrainingFeats = &#xD;
     Table[extractFeatures[&#xD;
       &amp;#034;https://github.com/vedadehhc/MoodDetector/raw/master/AudioData/&#xD;
        TrainingData/angry&amp;#034; &amp;lt;&amp;gt; ToString[i] &amp;lt;&amp;gt; &amp;#034;.wav&amp;#034;, 75], {i, 10}];&#xD;
    happyTrainingFeats = &#xD;
     Table[extractFeatures[&#xD;
       &amp;#034;https://github.com/vedadehhc/MoodDetector/raw/master/AudioData/&#xD;
       TrainingData/happy&amp;#034; &amp;lt;&amp;gt; ToString[i] &amp;lt;&amp;gt; &amp;#034;.wav&amp;#034;, 75], {i, 10}];&#xD;
    sadTrainingFeats = &#xD;
     Table[extractFeatures[&#xD;
       &amp;#034;https://github.com/vedadehhc/MoodDetector/raw/master/AudioData/&#xD;
       TrainingData/sad&amp;#034; &amp;lt;&amp;gt; ToString[i] &amp;lt;&amp;gt; &amp;#034;.wav&amp;#034;, 75], {i, 10}];&#xD;
&#xD;
### Get Testing Data&#xD;
I also imported my testing data in the same way, so that it could be passed as an argument to the Classifier Function. I&amp;#039;ll get this from GitHub as well. Note that this is the regular test data on GitHub.&#xD;
&#xD;
    angryTestingFeats =  &#xD;
     Table[extractFeatures[&#xD;
       &amp;#034;https://github.com/vedadehhc/MoodDetector/raw/master/AudioData/&#xD;
       TestingData/Regular/a&amp;#034; &amp;lt;&amp;gt; ToString[i] &amp;lt;&amp;gt; &amp;#034;.wav&amp;#034;, 75], {i, 10}];&#xD;
    happyTestingFeats =  &#xD;
     Table[extractFeatures[&#xD;
       &amp;#034;https://github.com/vedadehhc/MoodDetector/raw/master/AudioData/&#xD;
       TestingData/Regular/h&amp;#034; &amp;lt;&amp;gt; ToString[i] &amp;lt;&amp;gt; &amp;#034;.wav&amp;#034;, 75], {i, 10}];&#xD;
    sadTestingFeats =  &#xD;
     Table[extractFeatures[&#xD;
       &amp;#034;https://github.com/vedadehhc/MoodDetector/raw/master/AudioData/&#xD;
       TestingData/Regular/s&amp;#034; &amp;lt;&amp;gt; ToString[i] &amp;lt;&amp;gt; &amp;#034;.wav&amp;#034;, 75], {i, 10}];&#xD;
&#xD;
## Training a Classifier&#xD;
I constructed a Classifier Function using [Classify](https://reference.wolfram.com/language/ref/Classify.html).&#xD;
&#xD;
    classifier = &#xD;
     Classify[&amp;lt;|&amp;#034;angry&amp;#034; -&amp;gt; angryTrainingFeats, &#xD;
       &amp;#034;happy&amp;#034; -&amp;gt; happyTrainingFeats, &amp;#034;sad&amp;#034; -&amp;gt; sadTrainingFeats|&amp;gt;, &#xD;
      Method -&amp;gt; &amp;#034;LogisticRegression&amp;#034;]&#xD;
&#xD;
I ran the classifier on each set of training data.&#xD;
&#xD;
    classifier[angryTrainingFeats]&#xD;
    classifier[happyTrainingFeats]&#xD;
    classifier[sadTrainingFeats]&#xD;
&#xD;
I experimented with all of the built-in options for [Method](https://reference.wolfram.com/language/ref/Method.html) to construct a Classifier Function with the best accuracy. I found that [LogisticRegression](https://reference.wolfram.com/language/ref/method/LogisticRegression.html) gave the best accuracy at 77% accuracy on the test data. However, I wanted to improve the accuracy further.&#xD;
&#xD;
## Audio Pre-Processing&#xD;
One of the things that improved the Classifier&amp;#039;s accuracy substantially was cleaning the audio before extracting features and classifying. Specifically, I trimmed the audio using [AudioTrim](https://reference.wolfram.com/language/ref/AudioTrim.html), and filtered each clip using [HighpassFilter](https://reference.wolfram.com/language/ref/HighpassFilter.html) before extracting features. The audio cleaning function is included below.&#xD;
&#xD;
    cleanAudio[fileLocation_] := Module[{audio, trimmed, filtered},&#xD;
      audio = Import[fileLocation];&#xD;
      trimmed = AudioTrim[audio];&#xD;
      filtered = HighpassFilter[trimmed, Quantity[300, &amp;#034;Hertz&amp;#034;]]&#xD;
    ]&#xD;
&#xD;
### New Feature Extraction Function&#xD;
I updated the feature extraction function to include audio cleaning.&#xD;
&#xD;
    extractCleanFeatures[fileLocation_, parts_] :=  &#xD;
     Module[{audio, assoc, pdur, amp, freq, form}, &#xD;
      audio = cleanAudio[fileLocation];&#xD;
      pdur = AudioMeasurements[audio, &amp;#034;Duration&amp;#034;]/parts;&#xD;
      amp = AudioLocalMeasurements[audio, &amp;#034;RMSAmplitude&amp;#034;, &#xD;
         PartitionGranularity -&amp;gt; pdur] // Normal;&#xD;
      freq = AudioLocalMeasurements[audio, &amp;#034;FundamentalFrequency&amp;#034;, &#xD;
         MissingDataMethod -&amp;gt; {&amp;#034;Interpolation&amp;#034;, InterpolationOrder -&amp;gt; 1}, &#xD;
         PartitionGranularity -&amp;gt; pdur] // Normal;&#xD;
      form =  &#xD;
       AudioLocalMeasurements[audio, &amp;#034;Formants&amp;#034;, &#xD;
         PartitionGranularity -&amp;gt; pdur] // Normal;&#xD;
      assoc = &amp;lt;|&#xD;
        Table[&#xD;
         &amp;#034;amplitude&amp;#034; &amp;lt;&amp;gt; ToString[i] -&amp;gt; amp[[i]][[2]], {i, Length[amp]}], &#xD;
        Table[&#xD;
         &amp;#034;frequency&amp;#034; &amp;lt;&amp;gt; ToString[i] -&amp;gt; freq[[i]][[2]], {i, Length[freq]}], &#xD;
        &amp;#034;wordrate&amp;#034; -&amp;gt; &#xD;
         Length[TextWords[Quiet[SpeechRecognize[audio]]]]/&#xD;
          AudioMeasurements[audio, &amp;#034;Duration&amp;#034;],&#xD;
        Table[&#xD;
         Table[&amp;#034;formant&amp;#034; &amp;lt;&amp;gt; ToString[i] &amp;lt;&amp;gt; &amp;#034;-&amp;#034; &amp;lt;&amp;gt; ToString[j] -&amp;gt; &#xD;
           form[[i]][[j]], {j, Length[form[[i]]]}], {i, Length[form]}],&#xD;
        &amp;#034;pauses&amp;#034; -&amp;gt;  &#xD;
         Total[Abs /@ Subtract @@@ AudioIntervals[audio, &amp;#034;Quiet&amp;#034;]]/&#xD;
          AudioMeasurements[audio, &amp;#034;Duration&amp;#034;]&#xD;
        |&amp;gt;; &#xD;
      Map[Normal, assoc, {1}]&#xD;
    ]&#xD;
&#xD;
### New Results&#xD;
Using audio cleaning, the accuracy of the classifier improved to 90%, much better than before. The results can be seen in the Confusion Matrix Plot below, generated using [ClassifierMeasurements](https://reference.wolfram.com/language/ref/ClassifierMeasurements.html).&#xD;
&#xD;
![Confusion Matrix Plot for Regular Data][2]&#xD;
&#xD;
## Testing with Neutral Statements&#xD;
Now, up until now, the statements used for recordings were all emotional in nature. For example, the clips recorded in an angry mood also had an angry statement being said. In order to control for this, I recorded neutral statements in each mood. That is, I recorded each of ten emotionally neutral statements in each of the three moods. If the Classifier still works on this data, that would show that it is not relying on the content of the speech, but on other audio features, which is the intended method. I imported these data using the clean feature extractor and, once again, I&amp;#039;ll download them from my GitHub here. Note that this is the Neutral Statements data.&#xD;
&#xD;
    nAngryCleanTestingFeats =  &#xD;
      Table[extractCleanFeatures[&#xD;
        &amp;#034;https://github.com/vedadehhc/MoodDetector/raw/master/AudioData/&#xD;
        TestingData/NeutralStatements/a&amp;#034; &amp;lt;&amp;gt; ToString[i] &amp;lt;&amp;gt; &amp;#034;.wav&amp;#034;, 75], {i, &#xD;
        10}];&#xD;
    nHappyCleanTestingFeats =  &#xD;
     Table[extractCleanFeatures[&#xD;
       &amp;#034;https://github.com/vedadehhc/MoodDetector/raw/master/AudioData/&#xD;
       TestingData/NeutralStatements/h&amp;#034; &amp;lt;&amp;gt; ToString[i] &amp;lt;&amp;gt; &amp;#034;.wav&amp;#034;, 75], {i, &#xD;
       10}];&#xD;
    nSadCleanTestingFeats =  &#xD;
     Table[extractCleanFeatures[&#xD;
       &amp;#034;https://github.com/vedadehhc/MoodDetector/raw/master/AudioData/&#xD;
       TestingData/NeutralStatements/s&amp;#034; &amp;lt;&amp;gt; ToString[i] &amp;lt;&amp;gt; &amp;#034;.wav&amp;#034;, 75], {i, &#xD;
       10}];&#xD;
&#xD;
### Results for Neutral Statements&#xD;
I ran the clean Classifier on the new data, and the results were very positive. The classifier achieved an accuracy of 97% on the Neutral Statements data. The results are displayed in the Confusion Matrix Plot below, generated using [ClassifierMeasurements](https://reference.wolfram.com/language/ref/ClassifierMeasurements.html).&#xD;
&#xD;
![Confusion Matrix Plot for Neutral Statements Data][3]&#xD;
&#xD;
## Conclusions&#xD;
Overall, the Classifier was able to identify mood at 93% accuracy, even when the same statements were spoken in different moods. The composite Confusion Matrix Plot for all testing data can be seen below.&#xD;
&#xD;
![Confusion Matrix Plot for all test data][4]&#xD;
&#xD;
## Future Work&#xD;
In the future, I hope to improve the accuracy of the Classifier by providing additional training data, and to test it further with additional testing data. I also hope to expand the range of moods that the Classifier handles, including moods such as fear, calmness, and excitement. This, of course, would require the aforementioned additional data, and perhaps, more complex structures for the Classifier Function. In the future I would also like to experiment with multiple speakers, and determine whether classifiers for one speaker&amp;#039;s moods can be used to determine those of another speaker.&#xD;
&#xD;
## Acknowledgements&#xD;
I would like to thank my mentor Faizon Zaman for his guidance and assistance on this project.&#xD;
&#xD;
## GitHub&#xD;
You can find my code for this project on [my GitHub repository](https://github.com/vedadehhc/MoodDetector), with all code available beginning July 12th, 2019.&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=featureSpacePlotNoLabel.png&amp;amp;userId=1724789&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=CMP1.png&amp;amp;userId=1724789&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=CMP2.png&amp;amp;userId=1724789&#xD;
  [4]: https://community.wolfram.com//c/portal/getImageAttachment?filename=CMP3.png&amp;amp;userId=1724789</description>
    <dc:creator>Dev Chheda</dc:creator>
    <dc:date>2019-07-12T01:16:42Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/3067969">
    <title>None of the countries bordering Poland before 1990 exist today: the fall of the Berlin Wall and USSR</title>
    <link>https://community.wolfram.com/groups/-/m/t/3067969</link>
    <description>![enter image description here][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=_2_ezgif.com-optimizecopy.gif&amp;amp;userId=11733&#xD;
  [2]: https://www.wolframcloud.com/obj/34c7205a-40cd-4587-b6a1-f1fadc1ed8ce</description>
    <dc:creator>Vitaliy Kaurov</dc:creator>
    <dc:date>2023-11-21T01:14:10Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1379001">
    <title>[WSS18] Punctuation Restoration With Recurrent Neural Networks</title>
    <link>https://community.wolfram.com/groups/-/m/t/1379001</link>
    <description># Punctuation Restoration With Recurrent Neural Networks&#xD;
Mengyi Shan, Harvey Mudd College, mshan@hmc.edu        &#xD;
![flow][1]&#xD;
&#xD;
All codes posted on GitHub: [https://github.com/Shanmy/Summer2018Starter/tree/master/Project][2].&#xD;
Raw results in the attached notebook.&#xD;
&#xD;
----------&#xD;
&#xD;
## Introduction&#xD;
In natural language processing problems such as automatic speech recognition (ASR), the generated text is normally unpunctuated, which is hard for further recognition or analysis. Thus punctuation restoration is a small but crucial problem that deserves our attention. This project aims to build an automatic &amp;#034;punctuation adding&amp;#034; tool for plain English text with no punctuation. &#xD;
&#xD;
Since the input text could be considered as a sequence in which context is important for every single word&amp;#039;s properties, recurrent characteristics of neural networks are considered to be a good method. Traditional approaches to this problem include usage of various recurrent neural networks (RNN), especially long short-term memory layers (LSTM). This project examines several models built from different layers and introduces bidirectional operators which can significantly improve the result compared with old methods.&#xD;
&#xD;
## Methods&#xD;
![Basic steps of the method][3]&#xD;
&#xD;
There&amp;#039;re four basic steps in the whole process. First, we get the corpus of articles (with punctuations). Then, we keep the periods and commas in the corpus but change the question marks, exclamation marks, and colons to periods and commas, while removing all other punctuations. With this pure text, we tag each word as one of {NONE, COMMA, PERIOD} by judging if it is followed by a punctuation or not. And this set of tagging rules are sent to a neural network model for training. Finally, we test the result on another piece of articles, which is the test set.&#xD;
&#xD;
### Data&#xD;
Basically, we have two pieces of data. The first one is the Wikipedia text of 4000 nouns (deleting missing), and the second is 50 novels from Wolfram data repository.&#xD;
&#xD;
    (*Get wikipedia text of 4000 nouns*)&#xD;
    nounlist = Select[WordList[], WordData[#, &amp;#034;PartsOfSpeech&amp;#034;][[1]] == &amp;#034;Noun&amp;#034; &amp;amp;];&#xD;
    rawData = StringJoin @@ DeleteCases[Flatten[WikipediaData[#] &amp;amp; /@ Take[nounlist, {1, 4000}], 2], _Missing]&#xD;
&#xD;
    (*Get text of 50 novels*)&#xD;
    books = StringJoin @@ Get /@ ResourceSearch[&amp;#034;novels&amp;#034;, 50];&#xD;
&#xD;
### Pre-processing&#xD;
The first goal of the preprocessing step is to purify the text. That is, since we only consider commas and periods, we should either delete or replace other characters and punctuations. Also, for convenience, all numbers are replaced with 1 first. All other characters are removed from the text.&#xD;
&#xD;
    (*Show sets of characters replaced with comma, period, whitespace, one and null respectively*)&#xD;
    toComma = Characters[&amp;#034;:;&amp;#034;];&#xD;
    toPeriod = Characters[&amp;#034;!?&amp;#034;];&#xD;
    toWhiteSpace = {&amp;#034;-&amp;#034;, &amp;#034;\n&amp;#034;};&#xD;
    toOne = {&amp;#034;0&amp;#034;, &amp;#034;1&amp;#034;, &amp;#034;2&amp;#034;, &amp;#034;3&amp;#034;, &amp;#034;4&amp;#034;, &amp;#034;5&amp;#034;, &amp;#034;6&amp;#034;, &amp;#034;7&amp;#034;, &amp;#034;8&amp;#034;, &amp;#034;9&amp;#034;};&#xD;
    toNull[x_String] := Complement[Union[Characters[x]], ToUpperCase@Alphabet[], Alphabet[], toOne, toComma, toPeriod, toWhiteSpace, {&amp;#034;.&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034; &amp;#034;}];&#xD;
&#xD;
Then complete the replacement and modify it to pure form. And we include a validation test to examine its purity.&#xD;
   &#xD;
    (*Replacement and modification. End with lowercase text with only periods, alphabets and commas.*)&#xD;
    toPureText[x_String] := &#xD;
      StringReplace[#, &amp;#034;.,&amp;#034; .. -&amp;gt; &amp;#034;. &amp;#034;] &amp;amp;@&#xD;
                   StringReplace[#, &amp;#034;. &amp;#034; .. -&amp;gt; &amp;#034;. &amp;#034;] &amp;amp;@&#xD;
                 StringReplace[#, {&amp;#034; ,&amp;#034; -&amp;gt; &amp;#034;,&amp;#034;, &amp;#034; .&amp;#034; -&amp;gt; &amp;#034;.&amp;#034;}] &amp;amp;@&#xD;
               StringReplace[#, {&amp;#034;1&amp;#034; .. -&amp;gt; &amp;#034;one&amp;#034;, &amp;#034; &amp;#034; .. -&amp;gt; &amp;#034; &amp;#034;}] &amp;amp;@&#xD;
             StringReplace[#, {&amp;#034;1. 1&amp;#034; -&amp;gt; &amp;#034;&amp;#034;, &amp;#034;1, 1&amp;#034; -&amp;gt; &amp;#034;1&amp;#034;}] &amp;amp;@&#xD;
           StringReplace[#, {&amp;#034; &amp;#034; .. -&amp;gt; &amp;#034; &amp;#034;}] &amp;amp;@&#xD;
         StringReplace[#, {&amp;#034;,&amp;#034; -&amp;gt; &amp;#034;, &amp;#034;, &amp;#034;.&amp;#034; -&amp;gt; &amp;#034;. &amp;#034;}] &amp;amp;@&#xD;
       ToLowerCase@&#xD;
        StringReplace[{toComma -&amp;gt; &amp;#034;,&amp;#034;, toPeriod -&amp;gt; &amp;#034;.&amp;#034;, toNull[x] -&amp;gt; &amp;#034;&amp;#034;, &#xD;
           toWhiteSpace -&amp;gt; &amp;#034; &amp;#034;, toOne -&amp;gt; &amp;#034;1&amp;#034;}][x];&#xD;
    (*validation test*)&#xD;
    VerificationTest[Length@StringSplit@x == Length@TextWords@x]&#xD;
Then we define a function fPuncTag that can generate the corresponding tagging given a piece of text with punctuation. &#xD;
   &#xD;
    (*Define the tagging function, and maps it to original text. Original text is partitioned into pieces of 200 words*)&#xD;
     fPuncTag := Switch[StringTake[#, -1], &amp;#034;.&amp;#034;, &amp;#034;a&amp;#034;, &amp;#034;,&amp;#034;, &amp;#034;b&amp;#034;, _, &amp;#034;c&amp;#034;] &amp;amp;;&#xD;
     fWordTag[x_String] := Map[fPuncTag, Partition[StringSplit[x], 200], {2}];&#xD;
    &#xD;
And we can thus remove the punctuation, and build a set of rules between the unpunctuated text and the generated tagging.&#xD;
&#xD;
    fWordText[x_String] := StringReplace[#, {&amp;#034;,&amp;#034; -&amp;gt; &amp;#034;&amp;#034;, &amp;#034;.&amp;#034; -&amp;gt; &amp;#034;&amp;#034;}] &amp;amp; /@ StringRiffle /@ Partition[StringSplit[x], 200];&#xD;
    fWordTrain[x_String] := Normal@AssociationThread[fWordText[x], fWordTag[x]];&#xD;
    totalData = fWordTrain@toPureText@rawText&#xD;
&#xD;
With the total data, we want to divide it into three groups: the training set, the validation set, and the test set.&#xD;
&#xD;
    (* First we know that the length is 63252, then we divide it by 15:3:1*)&#xD;
    order = RandomSample[Range[63252]];&#xD;
    trainingSet = totalData[[Take[order, 50000]]];&#xD;
    validationSet = totalData[[Take[order, {50001, 60000}]]];&#xD;
    testSet = totalData[[Take[order, {60001, -1}]]];&#xD;
&#xD;
### Train&#xD;
&#xD;
During neural network training, I used 8 different combinations of layers, out of which 4 are worth considering. They are listed as followed. LSTM layer, gate recurrent layer, and basic recurrent layer are three types of recurrent layers, each representing a net that takes a sequence of vectors and outputs a sequence of the same length. LSTM is commonly used in natural language processing problems, so we start with it as a penetrating point.&#xD;
&#xD;
    (*Pure LSTM*)&#xD;
    net1 = NetChain[{&#xD;
        embeddingLayer,&#xD;
        LongShortTermMemoryLayer[100],&#xD;
        LongShortTermMemoryLayer[60],&#xD;
        LongShortTermMemoryLayer[30],&#xD;
        LongShortTermMemoryLayer[10],&#xD;
        NetMapOperator[LinearLayer[3]], &#xD;
        SoftmaxLayer[&amp;#034;Input&amp;#034; -&amp;gt; {&amp;#034;Varying&amp;#034;, 3}]}, &#xD;
       &amp;#034;Output&amp;#034; -&amp;gt; NetDecoder[{&amp;#034;Class&amp;#034;, {&amp;#034;a&amp;#034;, &amp;#034;b&amp;#034;, &amp;#034;c&amp;#034;}}]&#xD;
       ];&#xD;
&#xD;
    (*Gate Recurrent*)&#xD;
    net2 = NetChain[{&#xD;
        embeddingLayer,&#xD;
        LongShortTermMemoryLayer[100],&#xD;
        GatedRecurrentLayer[60],&#xD;
        LongShortTermMemoryLayer[30],&#xD;
        GatedRecurrentLayer[10],&#xD;
        NetMapOperator[LinearLayer[3]], &#xD;
        SoftmaxLayer[&amp;#034;Input&amp;#034; -&amp;gt; {&amp;#034;Varying&amp;#034;, 3}]}, &#xD;
       &amp;#034;Output&amp;#034; -&amp;gt; NetDecoder[{&amp;#034;Class&amp;#034;, {&amp;#034;a&amp;#034;, &amp;#034;b&amp;#034;, &amp;#034;c&amp;#034;}}]&#xD;
       ];&#xD;
&#xD;
    (Basic Recurrent)&#xD;
    net3 = NetChain[{&#xD;
        embeddingLayer,&#xD;
        LongShortTermMemoryLayer[100],&#xD;
        BasicRecurrentLayer[60],&#xD;
        LongShortTermMemoryLayer[30],&#xD;
        BasicRecurrentLayer[10],&#xD;
        NetMapOperator[LinearLayer[3]], &#xD;
        SoftmaxLayer[&amp;#034;Input&amp;#034; -&amp;gt; {&amp;#034;Varying&amp;#034;, 3}]}, &#xD;
       &amp;#034;Output&amp;#034; -&amp;gt; NetDecoder[{&amp;#034;Class&amp;#034;, {&amp;#034;a&amp;#034;, &amp;#034;b&amp;#034;, &amp;#034;c&amp;#034;}}]&#xD;
       ];&#xD;
&#xD;
    (*Bidirectional*)&#xD;
    net4 = NetChain[{&#xD;
        embeddingLayer,&#xD;
        LongShortTermMemoryLayer[100],&#xD;
        NetBidirectionalOperator[{LongShortTermMemoryLayer[40], &#xD;
          GatedRecurrentLayer[40]}],&#xD;
        NetBidirectionalOperator[{LongShortTermMemoryLayer[20], &#xD;
          GatedRecurrentLayer[20]}],&#xD;
        LongShortTermMemoryLayer[10],&#xD;
        NetMapOperator[LinearLayer[3]], &#xD;
        SoftmaxLayer[&amp;#034;Input&amp;#034; -&amp;gt; {&amp;#034;Varying&amp;#034;, 3}]}, &#xD;
       &amp;#034;Output&amp;#034; -&amp;gt; NetDecoder[{&amp;#034;Class&amp;#034;, {&amp;#034;a&amp;#034;, &amp;#034;b&amp;#034;, &amp;#034;c&amp;#034;}}]&#xD;
       ];&#xD;
&#xD;
The embedding layer is used to change words into vectors that represent their semantic characteristics.&#xD;
&#xD;
    (*The embedding layer here*)&#xD;
    embeddingLayer = NetModel[&amp;#034;GloVe 100-Dimensional Word Vectors Trained on Wikipedia and Gigaword 5 Data&amp;#034;]&#xD;
&#xD;
With all those neural network models set up, we can train each neural network. To save time, I first trained all models with a small data set of only 3 million words to compare their behaviors.&#xD;
&#xD;
    (*train the neural network while saving the training object*)&#xD;
    NetTrain[net, trainingSet, All, ValidationSet -&amp;gt; validationSet]&#xD;
### Test&#xD;
Since this classification problem is a problem of a skewed dataset, that is, most of the words should have the tag &amp;#034;None&amp;#034;, it doesn&amp;#039;t make sense to use &amp;#034;accuracy&amp;#034; to measure the models&amp;#039; behavior. Even if it simply do nothing and always return &amp;#034;None&amp;#034;, it will have a high accuracy that is the percentage of &amp;#034;None&amp;#034; in the whole tagging set. Instead, to evaluate the behavior of the models, we introduce the concept of precision, recall, and f1-score.&#xD;
&#xD;
    (*Precision and recall*)&#xD;
    precision = truePrediction/allTrue&#xD;
    recall = truePrediction/allPrediction&#xD;
    F1 = HarmonicMean[{precision, recall}]&#xD;
&#xD;
![PR][4]&#xD;
&#xD;
For a given test set, first, we want to remove its punctuations and run the trained model on it. &#xD;
&#xD;
    (*romve punctuation and run the model*)&#xD;
    noPuncTest = Keys /@ testSet&#xD;
    result = net[&amp;#034;TrainedNet&amp;#034;] /@ noPuncTest;&#xD;
    &#xD;
Then we changed the tags to 1,2 and 0. And we calculate the elementwise product of realTag and resultTag. If an element is 4, it means that both the realTag and resultTag is 2, which counts as a successful prediction of a comma. An element of 2 represents a successful prediction of a period.&#xD;
&#xD;
![Tag][5]&#xD;
&#xD;
&#xD;
    (*Change the tags to numerical values and count 1s and 4s*)&#xD;
    realTag = Replace[Flatten[Values /@ Take[testSet, 3252]], {&amp;#034;a&amp;#034; -&amp;gt; 1, &amp;#034;b&amp;#034; -&amp;gt; 2, &amp;#034;c&amp;#034; -&amp;gt; 0}, {1}];&#xD;
    resultTag = Replace[Flatten[result], {&amp;#034;a&amp;#034; -&amp;gt; 1, &amp;#034;b&amp;#034; -&amp;gt; 2, &amp;#034;c&amp;#034; -&amp;gt; 0}, {1}];&#xD;
    totalTag = realTag*resultTag;&#xD;
&#xD;
Now we can use totalTag, resultTag, and realTag to calculate precision, recall, and f1-score.&#xD;
&#xD;
    (*Precision*)&#xD;
    PrecPeriod = N@Count[totalTag, 1]/Count[resultTag, 1]&#xD;
    PrecComma = N@Count[totalTag, 4]/Count[resultTag, 2]&#xD;
    (*Recall*)&#xD;
    RecPeriod = N@Count[totalTag, 1]/Count[realTag, 1]&#xD;
    RecComma = N@Count[totalTag, 4]/Count[realTag, 2]&#xD;
    (*F1*)&#xD;
    F1Period = (2*RecPeriod*PrecPeriod)/(RecPeriod + PrecPeriod)&#xD;
    F1Comma = (2*RecComma*PrecComma)/(RecComma + PrecComma)&#xD;
&#xD;
## Result&#xD;
Ten neural networks are trained based on a small dataset with different layers. Only using Long Short-Term Memory layers gives an f1 score of 13% and 11% for periods and commas. Introducing dropout parameters, pooling layers, elementwise layers, basic recurrent layers and gate recurrent layers all produce an f1 score between 10% and 30%, showing no significant improvement. Introduction of the bidirectional operator (combining two recurrent layers) improves the scores to 53% and 47%, and to 72% and 60% respectively when training on a larger dataset of 10M words.&#xD;
&#xD;
 Here are the results for the three different neural networks trained with a 3M small dataset, and bidirectional neural network (which has the best performance in the small dataset) trained with a larger dataset of 10M words. The first figure is of the period and the second is of the comma.&#xD;
![Period][6]&#xD;
![Comma][7]&#xD;
&#xD;
We can easily observe the advantage of the bidirectional operator in terms of both periods and commas, precision and recall. Instead of the sequence to sequence learning, &amp;#034;tagging&amp;#034; is a significantly more efficient and accurate way to restore punctuation in plain text. Since every words&amp;#039; tags (&amp;#034;None&amp;#034;, &amp;#034;Comma&amp;#034;, &amp;#034;Period&amp;#034;) is influenced by its context, it makes sense that recurrent neural networks and bidirectional operators show great potential in this research.&#xD;
&#xD;
Generally, the recall score is significantly lower than the precision score, suggesting that the model generates too many punctuations than it should. This could be due to the dataset of Wikipedia which is not clean enough. In the Wikipedia text, sometimes there&amp;#039;re equations, translations, or other strange characters that we simply delete. This changed the ratio of punctuations to words and produces some segments of text that is &amp;#034;full of&amp;#034; punctuations since all words are not recognized and simply deleted. One example of those &amp;#034;not clean segment&amp;#034; is shown below.&#xD;
&#xD;
![wiki][8]&#xD;
&#xD;
Also, the overall performance on commas is slightly worse than on periods. This also makes sense from a linguistics point of view. There seems to be a concrete linguistics set of rules for the period, but the usage of comma greatly depends on personal writing style. For example, you could say either *&amp;#034;I like apples but I don&amp;#039;t like bananas.&amp;#034;*, or *&amp;#034;I like apples, but I don&amp;#039;t like bananas.&amp;#034;* In this way, it&amp;#039;s really hard to build a model for comma prediction with such high accuracy. But fortunately, sometimes adding commas or not doesn&amp;#039;t really influence the overall meaning of the sentence. So it&amp;#039;s okay to be tolerant to a slightly worse performance on commas.&#xD;
&#xD;
## Future Works&#xD;
70% f1-score is still not enough for the application. Planned future work focuses on improving accuracy to a level suitable for usage in industry. The most urgent and important future work is using a larger data size. We can observe great improvement when changing from 3M to 10M dataset, but it&amp;#039;s still far less than enough. &#xD;
&#xD;
![plot][9]&#xD;
&#xD;
If we take a closer look at the evolution plots during training, we can see that the error rate and loss of training set are continuously decreasing, while the error rate and loss of the validation set soon reaches a stable state and doesn&amp;#039;t change too much. The gap between those two curves suggests the possibility of overfitting, and it should greatly help if we introduce better and more data.&#xD;
&#xD;
Also, punctuation restoration should not be limited to periods and comma. A more rigorous study of the question mark, exclamation mark, colon, and quotation mark is expected. However, we should note that the choice of most punctuations is not restricted to one possibility. In cases like distinguishing a period with an exclamation mark, we cannot expect a high f1-score. But it&amp;#039;s still an interesting topic, may be useful for topics like sentimental analysis.&#xD;
&#xD;
## Acknowledgement&#xD;
I would like to thank the summer school for providing the environment and background skills for me to finish this project. Especially, I want to thank my mentor for helping me with neural network problems and debugging.&#xD;
&#xD;
## Data and Reference&#xD;
&#xD;
 - [Wolfram Data Repository][10]&#xD;
 - [Wikipedia][11]&#xD;
 - Tilk O, et al. &amp;#034;Lstm for Punctuation Restoration in Speech Transcripts.&amp;#034; Proceedings of the Annual Conference of the International Speech Communication Association, Interspeech, 2015-January, 2015, pp. 683\687.&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-07-10at7.10.22PM.png&amp;amp;userId=1362824&#xD;
  [2]: https://github.com/Shanmy/Summer2018Starter/tree/master/Project&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-07-11at10.22.30AM.png&amp;amp;userId=1362824&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=PR1.png&amp;amp;userId=1362824&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-07-11at11.45.44AM.png&amp;amp;userId=1362824&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-07-10at8.38.40PM.png&amp;amp;userId=1362824&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-07-10at8.38.49PM.png&amp;amp;userId=1362824&#xD;
  [8]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-07-11at12.13.54PM.png&amp;amp;userId=1362824&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2018-07-10at8.59.14PM.png&amp;amp;userId=1362824&#xD;
  [10]: https://datarepository.wolframcloud.com/category/Text-Literature/&#xD;
  [11]: https://www.wikipedia.org</description>
    <dc:creator>Mengyi Shan</dc:creator>
    <dc:date>2018-07-11T17:20:45Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1962739">
    <title>[CALL] ways to visualize COVID-19 simulation results?</title>
    <link>https://community.wolfram.com/groups/-/m/t/1962739</link>
    <description>*MODERATOR NOTE: coronavirus resources &amp;amp; updates:* https://wolfr.am/coronavirus&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
&#xD;
[updated notebooks in comments - please go to latest]&#xD;
&#xD;
Hello Community, so I am working on enumerating the possible data visualizations of the results that will be coming from a monte carlo simulation of the effects of COVID-19 after various reopening scenarios. This post is strictly seeking contributions to visualizing the toy dataset defined in the attached notebook (the actual simulation is being done by someone else and is not ready yet). If you want to contribute to a system to help educate decision makers about various ways to think about this challenge in the face of great uncertainty in data, simulation, and underlying models, then please download the attached notebook, create a function that visualizes some aspect of the data like the first few examples I have added in the notebook, then post your results here. Given a clean data spec there are so many ways to visualize the data and each way allows someone to answer different questions. Let&amp;#039;s help everyone wrap there head around this!&#xD;
&#xD;
Here is a simple graphical model of the data that will come out of the simulation...&#xD;
&#xD;
![enter image description here][1]&#xD;
&#xD;
Here is the first example of a visualization of one aspect of the data...&#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=covid.png&amp;amp;userId=26311&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=1000-100-10_population.png&amp;amp;userId=26311</description>
    <dc:creator>Kyle Keane</dc:creator>
    <dc:date>2020-05-03T03:24:46Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2847286">
    <title>Shakespearean GPT from scratch: create a generative pre-trained transformer</title>
    <link>https://community.wolfram.com/groups/-/m/t/2847286</link>
    <description>![enter image description here][1]&#xD;
&#xD;
&amp;amp;[Wolfram Notebook][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=ShakespeareanGPT.png&amp;amp;userId=20103&#xD;
  [2]: https://www.wolframcloud.com/obj/bd95b76b-1086-414d-911a-f9bc349c3527</description>
    <dc:creator>Jofre Espigule-Pons</dc:creator>
    <dc:date>2023-03-08T09:33:20Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1007290">
    <title>Idea-nets and uniqueness of US inaugural addresses</title>
    <link>https://community.wolfram.com/groups/-/m/t/1007290</link>
    <description>*NOTE: click on images to see high resolution*&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
[![enter image description here][1]][2]&#xD;
&#xD;
&#xD;
What is common between a symphony and a novel? They both progress linearly in time. This is why songs match lyrics and music so well. This seems obvious but comprehension of spacial objects is different. You can look at a two-dimensional painting and your sense of art is driven by the simultaneous perception of different spacial regions and their properties: color, contrast, etc. The simultaneous comparison of many different parts is the very mechanism of spacial perception. In contrast an average person cannot read more than one sentence at a time. And listening to the same parts of melody simultaneously can create cacophony or at least shift from the intended by creator sound. Because our consciousness is forced to constantly move though time and not space, we perceive spacial and temporal structures differently. &#xD;
&#xD;
We use memory to improve comprehension of temporal phenomena. But it is till quite hard to remember and compare many different moments simultaneously. Remembering the secondary sense of &amp;#034;relations&amp;#034; or &amp;#034;correlations&amp;#034; between different moments is even harder. What if we could extract important information from a temporal structure and reflect it via a spacial visual representation?&#xD;
&#xD;
As an example let&amp;#039;s take US presidents inaugural addresses. They are short pieces of text that at times may seem very similar to each other. So there there are 2 levels of comparison:&#xD;
&#xD;
1. What are ideas and relations between them in a single speech? &#xD;
&#xD;
2. What is common and different between different speeches?&#xD;
&#xD;
It is possible to create some very simple tools of text processing that give some immediate insight. In the image above you see a take on Obama 2013 and Trump 2017 inauguration speeches. Top idea-networks reflect the top ideas and relationships between them inside a speech. The top-terms are also clustered to indicate which ideas are in the tighter relationships. And word clouds show common and unique top words for each presidential address. Also notice, that while the common words are &amp;#034;common&amp;#034; they have different weights for each address, which redistributes the meaningful stress between common ideas.&#xD;
&#xD;
The Wolfram Language code for building these objects is below. It works in a very simple way. For word clouds you find unique and common words and then find their statistical weights. For the idea networks it is just a little bit more subtle. First you find &amp;#034;top terms&amp;#034; by deleting stop words and tallying the rest. Than you say that only tally weighting greater than a specific threshold counts as a &amp;#034;main idea&amp;#034; on which you build your network. The edges are drown between top-terms that are direct neighbors in the text. Thresholding of tally could be a bit misleading as selection of this cutoff is subjective and per-candidate specific. This means that a threshold chosen for one candidate may not work as well for the other because they may generate different statistical distribution of top-terms in the speeches. For Obama and Trump in the image above I used slightly different thresholds to get nicer visualizations. As a counterexample, below are net-ideas of inaugural addresses for the rest of 56 US presidents thresholded at the same **&amp;#034;Obama-level&amp;#034;**. As you can see sometimes the nets are overloaded and sometimes they are too simple. Which in itself tells something about different structures of texts and prompt us for careful treatment of the threshold. &#xD;
&#xD;
The final code and more details are given below.&#xD;
&#xD;
[![enter image description here][3]][3]&#xD;
&#xD;
A unique feature of Wolfram Language a multitudes of built-in curated data. We can access all inauguration speeches as&#xD;
&#xD;
    allOBJ = SortBy[ResourceData[&amp;#034;Presidential Inaugural Addresses&amp;#034;], &amp;#034;Date&amp;#034;];&#xD;
&#xD;
This is a sample of the dataset:&#xD;
&#xD;
    Column[allOBJ /@ {1, -1}]&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
Extract all texts and names and dates:&#xD;
&#xD;
    allTEXT = Normal[allOBJ[All, &amp;#034;Text&amp;#034;]];&#xD;
    allNAME = Normal[allOBJ[All, DateString[#Date, &amp;#034;Year&amp;#034;] &amp;lt;&amp;gt; &amp;#034; &amp;#034; &amp;lt;&amp;gt; CommonName[#Name] &amp;amp;]];&#xD;
&#xD;
# Idea-network &#xD;
&#xD;
Idea-nets are built &#xD;
&#xD;
    ideaNET[text_String,order_]:=&#xD;
    Module[&#xD;
    	{wordsTOP, edges,resctal, words=TextWords[DeleteStopwords[ToLowerCase[text]]]},&#xD;
    	resctal=Transpose[MapAt[N[Rescale[#]]&amp;amp;,Transpose[Tally[words]],2]];&#xD;
    	wordsTOP=Select[resctal,Last[#]&amp;gt;=order &amp;amp;];&#xD;
    	edges=UndirectedEdge@@@DeleteDuplicates[Sort/@DeleteCases[&#xD;
    			Partition[Cases[words,Alternatives@@wordsTOP[[All,1]]],2,1],{x_String,x_String}]];&#xD;
    	CommunityGraphPlot[&#xD;
    		Graph[edges,&#xD;
    			VertexSize-&amp;gt;Thread[wordsTOP[[All,1]]-&amp;gt;.1+.9wordsTOP[[All,2]]],&#xD;
    			VertexLabels-&amp;gt;Automatic,VertexLabelStyle-&amp;gt;Directive[20,White,Opacity[.8]],&#xD;
    			GraphStyle-&amp;gt;&amp;#034;Prototype&amp;#034;,Background-&amp;gt;Black],&#xD;
    	CommunityBoundaryStyle-&amp;gt;Directive[GrayLevel[.4],Dashed],&#xD;
    	CommunityRegionStyle-&amp;gt;GrayLevel[.2],&#xD;
    	ImageSize-&amp;gt;800{1,1},&#xD;
    	PlotRangePadding-&amp;gt;{{.1,.3},{0.1,0.1}}]&#xD;
    ]&#xD;
&#xD;
## Example: JFK inaugural address:&#xD;
&#xD;
    ideaNET[allTEXT[[-15]], .17]&#xD;
&#xD;
[![enter image description here][5]][5]&#xD;
&#xD;
# Unique and common top-terms&#xD;
&#xD;
The code that makes very top graphics is:&#xD;
&#xD;
    plusCLOUD[allTEXT[[-2]], allTEXT[[-1]], &amp;#034;o b a m a  &amp;#039;13&amp;#034;, &amp;#034;t ru m p &amp;#039;17&amp;#034;]&#xD;
&#xD;
With idea-nets defined as above and `plusCLOUD` as below:&#xD;
&#xD;
    plusCLOUD[text1_String,text2_String,label1_String,label2_String]:=&#xD;
    Module[&#xD;
    	{same,&#xD;
    	words1=TextWords[DeleteStopwords[ToLowerCase[text1]]],&#xD;
    	words2=TextWords[DeleteStopwords[ToLowerCase[text2]]]},&#xD;
    	same=Intersection[words1,words2];&#xD;
    	Grid[&#xD;
    		{{&amp;#034;&amp;#034;,Column[{&#xD;
    				Style[label1,80,Blue,FontFamily-&amp;gt;&amp;#034;Phosphate&amp;#034;],&#xD;
    				Style[&amp;#034;inaugural address&amp;#034;,45,Gray,FontFamily-&amp;gt;&amp;#034;Copperplate&amp;#034;]&#xD;
    			},Alignment-&amp;gt;Center],&#xD;
    			Column[{&#xD;
    				Style[label2,80,Red,FontFamily-&amp;gt;&amp;#034;Phosphate&amp;#034;],&#xD;
    				Style[&amp;#034;inaugural address&amp;#034;,45,Gray,FontFamily-&amp;gt;&amp;#034;Copperplate&amp;#034;]&#xD;
    			},Alignment-&amp;gt;Center]},&#xD;
    		{Framed[Column[Style[#,35,FontFamily-&amp;gt;&amp;#034;DIN Condensed&amp;#034;]&amp;amp;/@Characters[&amp;#034;idea network&amp;#034;],&#xD;
    			Alignment-&amp;gt;Center],FrameStyle-&amp;gt;White,FrameMargins-&amp;gt;10],&#xD;
    		ideaNET[text1,.21],ideaNET[text2,.18]},&#xD;
    		{Framed[Column[Style[#,35,FontFamily-&amp;gt;&amp;#034;DIN Condensed&amp;#034;]&amp;amp;/@Characters[&amp;#034;unique words&amp;#034;],&#xD;
    			Alignment-&amp;gt;Center],FrameStyle-&amp;gt;White,FrameMargins-&amp;gt;10],&#xD;
    		WordCloud[DeleteCases[words1,Alternatives@@same],ImageSize-&amp;gt;800{1,1},&#xD;
    			ColorFunction-&amp;gt;(ColorData[&amp;#034;DeepSeaColors&amp;#034;][(.2+#)/1.2]&amp;amp;),Background-&amp;gt;Black],&#xD;
    		WordCloud[DeleteCases[words2,Alternatives@@same],ImageSize-&amp;gt;800{1,1},&#xD;
    			ColorFunction-&amp;gt;(ColorData[&amp;#034;ValentineTones&amp;#034;][(.2+#)/1.2]&amp;amp;),Background-&amp;gt;Black]},&#xD;
    		{Framed[Column[Style[#,35,FontFamily-&amp;gt;&amp;#034;DIN Condensed&amp;#034;]&amp;amp;/@Characters[&amp;#034;common words&amp;#034;],Alignment-&amp;gt;Center],FrameStyle-&amp;gt;White,FrameMargins-&amp;gt;10],&#xD;
    		WordCloud[Cases[words1,Alternatives@@same],ImageSize-&amp;gt;800{1,1},&#xD;
    			ColorFunction-&amp;gt;(ColorData[&amp;#034;AvocadoColors&amp;#034;][(.2+#)/1.2]&amp;amp;),Background-&amp;gt;Black],&#xD;
    		WordCloud[Cases[words2,Alternatives@@same],ImageSize-&amp;gt;800{1,1},&#xD;
    			ColorFunction-&amp;gt;(ColorData[&amp;#034;AvocadoColors&amp;#034;][(.2+#)/1.2]&amp;amp;),Background-&amp;gt;Black]&#xD;
    		}},&#xD;
    	Spacings-&amp;gt;{0, 0}]&#xD;
    ]&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com//c/portal/getImageAttachment?filename=trump.png&amp;amp;userId=11733&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=trump.png&amp;amp;userId=11733&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=qwe434tgwrefv.png&amp;amp;userId=11733&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-02-03at8.09.19AM.png&amp;amp;userId=11733&#xD;
  [5]: http://community.wolfram.com//c/portal/getImageAttachment?filename=JFKiadss.png&amp;amp;userId=11733</description>
    <dc:creator>Vitaliy Kaurov</dc:creator>
    <dc:date>2017-02-03T14:29:00Z</dc:date>
  </item>
</rdf:RDF>

