top of page

Sentiment Bouquet

Keywords: Javascript, P5.js, Sentiment Analysis, L-System...

145752648-dd0a7c93-ed91-4c00-bd98-74e35c24490b.jpg
145752663-6afbe1fd-60ec-4d78-8865-af3c6f15c3f5.png

<Sentiment Bouquet>        2022         Designed and documented by Xiangrui Zeng

Sentiment Bouquet generates digital flowers with text. I made a p5.js website where people can type in some text and they will get a bouquet showing on the screen. The color and shape of the flowers would vary based on the sentiment analysis of the text and I used L-System to design the growth of flowers. The purpose of this project is to make it a digital flowers sending website. As sometimes we want to send someone flowers but we can't physically do that because of distance or some other situations. On this website, I want the users to be able to generate flowers with what they want to say, so they can send someone digital flowers!

145753076-56981ffa-4278-469b-851c-6989c4d67dbe copy.png
145753072-317e6484-33c6-41fd-b3ba-0384823c77c7.png
145753087-65177307-6a07-46b7-881d-ccc98a3c37dc.png

Process

First, I downloaded an AFINN library to calculate the sentiment scores. I also calculated the division result of the total score and the typed-in words length to get a comparative score of the whole sentence. Then I wrote an L-system grammar to generate the branches and flowers. The color of the flowers changes based on the comparative score. I made seven colors to match the score. A more positive score gives you pink and red flowers, and a more negative score generates more bluish flowers. The shape and the size of the flower are totally random.

 

Get your bouquet

Code

Github

bottom of page