Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Russell Jarvis
ScienceAccess
Commits
cec8f555
Commit
cec8f555
authored
Dec 10, 2021
by
Russell Jarvis
💬
Browse files
update for web app
parent
2f74b525
Pipeline
#1596
failed with stages
in 4 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app.py
View file @
cec8f555
...
...
@@ -613,31 +613,31 @@ def main():
np
.
mean
(
average_reading_time
),
author_name
,
len
(
ar
)
)
)
if
"sentiment"
in
genre
:
sentiment
=
[]
uniqueness
=
[]
for
block
in
trainingDats
:
uniqueness
.
append
(
block
[
"uniqueness"
])
sentiment
.
append
(
block
[
"sp"
])
temp
=
np
.
mean
(
sentiment
)
<
np
.
mean
([
r
[
"sp"
]
for
r
in
ar
])
st
.
markdown
(
"""### Sentiment"""
)
st
.
markdown
(
"""It is {} that the mean sentiment of {}'s writing is more postive relative to that of Readability of the ART Corpus.
"""
.
format
(
temp
,
author_name
)
)
#
if "sentiment" in genre:
#
sentiment = []
#
uniqueness = []
#
for block in trainingDats:
#
uniqueness.append(block["uniqueness"])
#
sentiment.append(block["sp"])
#
temp = np.mean(sentiment) < np.mean([r["sp"] for r in ar])
#
st.markdown("""### Sentiment""")
#
st.markdown(
#
"""It is {} that the mean sentiment of {}'s writing is more postive relative to that of Readability of the ART Corpus.
#
""".format(
#
temp, author_name
#
)
#
)
temp
=
"{0} positive sentiment"
.
format
(
author_name
)
labels
=
[
temp
,
"ART Corpus positive sentiment"
]
values
=
[
np
.
mean
([
r
[
"sp"
]
for
r
in
ar
]),
np
.
mean
(
sentiment
)]
#
temp = "{0} positive sentiment".format(author_name)
#
labels = [temp, "ART Corpus positive sentiment"]
#
values = [np.mean([r["sp"] for r in ar]), np.mean(sentiment)]
# urlDat["reading_time"]
fig
=
go
.
Figure
(
data
=
[
go
.
Pie
(
labels
=
labels
,
values
=
values
,
hole
=
0.3
)])
st
.
write
(
fig
)
#
fig = go.Figure(data=[go.Pie(labels=labels, values=values, hole=0.3)])
#
st.write(fig)
st
.
markdown
(
"
\n
"
)
#
st.markdown("\n")
if
__name__
==
"__main__"
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment