Creates a bar plot showing the frequency distribution of named entity types.
Usage
plot_entity_frequencies(
entity_data,
top_n = 20,
title = "Named Entity Type Frequency",
color = "#10B981",
height = 500,
width = NULL
)Arguments
- entity_data
Data frame containing entity data with columns:
entity: Named entity type (e.g., "PERSON", "ORG", "GPE")n: (optional) Pre-computed frequency count
If
nis not present, frequencies will be computed from the data.- top_n
Number of top entity types to display (default: 20)
- title
Plot title (default: "Named Entity Type Frequency")
- color
Bar color (default: "#10B981")
- height
Plot height in pixels (default: 500)
- width
Plot width in pixels (default: NULL for auto)
See also
Other visualization:
apply_standard_plotly_layout(),
create_empty_plot_message(),
create_message_table(),
create_standard_ggplot_theme(),
get_dt_options(),
get_plotly_hover_config(),
get_sentiment_color(),
get_sentiment_colors(),
plot_cluster_terms(),
plot_cross_category_heatmap(),
plot_mwe_frequency(),
plot_ngram_frequency(),
plot_pos_frequencies(),
plot_semantic_viz(),
plot_similarity_heatmap(),
plot_term_trends_continuous(),
plot_word_frequency()
Examples
if (interactive()) {
entity_df <- data.frame(
entity = c("PERSON", "ORG", "GPE", "DATE", "MONEY"),
n = c(300, 250, 200, 150, 100)
)
plot_entity_frequencies(entity_df)
}
