OneCompiler

movie review

124
<!DOCTYPEhtml> <html> <head> <titl e>ValidateUserNameandPassword</titl <script> Functionvali dateForm(){ e> Varusername=document.forms[“myForm”][“username”]. value; Varpassword=document.forms[“myForm”][“password”]. value; If(username==“”){ Alert(“Usernamemustbefil ledout”); Returnfalse; } If(password==“”){ Alert(“Passwordmustbefi lledout”); Returnfalse; } } </scri pt> </head> <body> <h2>ValidateUserNameandPassword</h2> <formname=”myForm”onsubmit=”returnvali <labelfor=”username”>Username: <inputtype=”text”i </label dateForm()”method=”post”> > d=”username”name=”username”><br><br> <labelfor=”password”>Password: </label > <inputtype=”password”i d=”password”name=”password”><br><br> <inputtype=”submi t”value=”Submit”> </form> </body>

Importpandasaspd
FromtextblobimportTextBl
ob
FromwordcloudimportWordCloud,STOPWORDS
Importmatplotl
ib.pypl
otasplt
nk
ew.csvto
#Loadthedataset
Df=pd.read_csv(‘
movie_revi
ew.csv’
)
#AddacolumnforsentimentanalysisusingTextBlob
Df[‘
Sentiment’
]=df[‘Revi
ew’].appl
y(lambdax:TextBlob(x).
#Createanewdataframeforpositivereviewsonly
Pos_df=df[df[‘
Sentiment’
]>0.2]
#Createawordcloudforpositiverevi
ews
Wordcloud=WordCloud(width=800,height=800,
Background_color=’
white’
,
Stopwords=STOPWORDS,
Min_font_si
ze=10).generate(‘‘
#Plotthewordcloud
Plt.fi
gure(fi
gsize=(8,8),facecol
Plt.i
mshow(wordcloud)
Plt.axi
s(“off”)
Plt.ti
ght_layout(pad=0)
Plt.show(