Skip to content

Commit

Permalink
don't do frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed Dec 14, 2024
1 parent 0258ab4 commit be2a52f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
11 changes: 11 additions & 0 deletions app/assets/stylesheets/entries.scss
Original file line number Diff line number Diff line change
Expand Up @@ -495,3 +495,14 @@ mark {
}

.note-editor .note-dropzone { opacity: 0 !important; }

.emotion-link {
text-decoration: none;
margin-left: 2px;
margin-right: 2px;
transition: transform 0.3s ease; /* Smooth transition */
}

.emotion-link:hover {
transform: scale(1.1); /* Scale up to 110% */
}
2 changes: 1 addition & 1 deletion app/views/entries/review.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
= pie_chart(@sentiment_count, height: "230px", library: {backgroundColor: "#ffffff"})
.clearfix
- @entries_with_sentiment.pluck(:sentiment).flatten.uniq.sort.each do |sentiment|
= link_to "#{Entry::AiTagger::EMOTIONS[sentiment]}", entries_emotion_path(sentiment), style: "text-decoration: none; margin-left: 2px; margin-right: 2px;", title: "View entries tagged with #{sentiment}"
= link_to "#{Entry::AiTagger::EMOTIONS[sentiment]}", entries_emotion_path(sentiment), class: "emotion-link", title: "View entries tagged with #{sentiment}"

.col-md-8.col-md-offset-2.well
.center{class: add_class}
Expand Down
8 changes: 4 additions & 4 deletions lib/tasks/entry.rake
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ namespace :entry do
tokenizer = WordsCounted::Tokeniser.new(entries_bodies).tokenise(exclude: Entry::WORDS_NOT_TO_COUNT)
total_words = tokenizer.count

counter = WordsCounted.count(entries_bodies)
most_frequent = counter.token_frequency.first(400).select { |w| !Entry::COMMON_WORDS.include?(w[0]) }.first(40).map { |w| "#{w[0]}: #{number_with_delimiter(w[1])}" }
# counter = WordsCounted.count(entries_bodies)
# most_frequent = counter.token_frequency.first(400).select { |w| !Entry::COMMON_WORDS.include?(w[0]) }.first(40).map { |w| "#{w[0]}: #{number_with_delimiter(w[1])}" }

avg_words = total_words / all_entries.count
total_chars = entries_bodies.length
Expand All @@ -161,8 +161,8 @@ namespace :entry do
p "Avg words per post: #{number_with_delimiter(avg_words)}"
p "Total characters: #{number_with_delimiter(total_chars)}"
p "Avg characters per post: #{number_with_delimiter(avg_chars)} (#{avg_tweets_per_post} tweets)"
p "Most Frequent Words:"
puts most_frequent
# p "Most Frequent Words:"
# puts most_frequent
p "*"*100
end

Expand Down

0 comments on commit be2a52f

Please sign in to comment.