diff --git a/app/services/documents/analysis/parts_of_speech_service.rb b/app/services/documents/analysis/parts_of_speech_service.rb index 217cc123..3a61b06b 100644 --- a/app/services/documents/analysis/parts_of_speech_service.rb +++ b/app/services/documents/analysis/parts_of_speech_service.rb @@ -5,15 +5,17 @@ module Documents analysis = DocumentAnalysis.find(analysis_id) document = analysis.document - analysis.noun_count = document.nouns.count - analysis.adjective_count = document.adjectives.count - analysis.verb_count = document.verbs.count - analysis.pronoun_count = document.pronouns.count + analysis.noun_count = document.nouns.count + analysis.adjective_count = document.adjectives.count + analysis.verb_count = document.verbs.count + analysis.pronoun_count = document.pronouns.count # analysis.preposition_count = document.prepositions.count - analysis.conjunction_count = document.conjunctions.count - analysis.adverb_count = document.adverbs.count + analysis.conjunction_count = document.conjunctions.count + analysis.adverb_count = document.adverbs.count # analysis.determiner_count = document.determiners.count + analysis.interrogative_count = document.interrogatives.count + # TODO other POS counters: # - numbers # - stop words diff --git a/app/views/documents/analysis/sections/_entities.html.erb b/app/views/documents/analysis/sections/_entities.html.erb index 7c650c95..f980f07a 100644 --- a/app/views/documents/analysis/sections/_entities.html.erb +++ b/app/views/documents/analysis/sections/_entities.html.erb @@ -2,15 +2,30 @@
<% analysis.document_entities.order('entity_type').each do |entity| %> <% entity_class = entity.entity_type.constantize %> -
+
-
-
- <%= entity_class.icon %> +
+ <%# todo page image if matched to a page + images exist %> + <%= image_tag 'card-headers/' + entity_class.name.downcase.pluralize + '.jpg', class: 'activator' %> +
+
+ + <%= entity_class.icon %> <%= entity.text %> -
-
    -
  • Relevance: <%= entity.relevance %>
  • + more_vert + +

    + Relevance: <%= entity.relevance %> +

    +
+
+ + <%= entity_class.icon %> + <%= entity.text %> + close + +
+
  • Sentiment: <%= entity.sentiment_label %> (<%= entity.sentiment_score %>)
  • Joy: <%= entity.joy_score %>
  • Sadness: <%= entity.sadness_score %>
  • @@ -19,11 +34,54 @@
  • Anger: <%= entity.anger_score %>
-
+ + + <% end %>
@@ -35,17 +93,15 @@
-