read_TopicModel_method: Fulltext Inspection for TopicModel.

Description Usage Arguments Examples

Description

Highlight the vocabulary indicative of the top terms (number specified by no_topics) for the top topics (number specified by no_topicspresent in a partition.

Usage

1
2
3
4
get_highlight_list(.Object, partition_obj, no_topics = 3L, no_token = 20L)

## S4 method for signature 'TopicModel'
read(.Object, partition_obj, no_topics = 3L, no_token = 20L)

Arguments

.Object

Object of class TopicModel, or a class inheriting from it.

partition_obj

A partition object, the partition to display.

no_topics

The number of the most prevalant topics in a text that will be highlighted.

no_token

An integer value, the number of tokens indicative of a topic according to the input topic model to be be highlighted

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
data(BE_lda)
data(BE_labels)
data(BE_exclude)

BE <- Topicanalysis$new(topicmodel = BE_lda)
BE$labels <- BE_labels
BE$type <- "plpr_partition"

topic_flucht <- 125L
topic_integration <- 241
BE$docs(x = 125L, y = 241L)

# As sample data, we use a corpus of plenary debates in the 
# 'Berliner Abgeordnetenhaus'. It is somewhat big and not included
# in the package by default. 

## Not run: 
polmineR::use("topicanalysis")
if (!"BE" %in% corpus()$corpus){
  cwbtools::corpus_install(
    pkg = "topicanalysis",
    tarball = "http://polmine.sowi.uni-due.de/corpora/cwb/berlin/be.tar.gz"
  )
  polmineR::use("topicanalysis") # to activate corpus 'BE'
}

p <- partition("BE", date = "2005-04-28", who = "Körting")
p <- polmineR::as.speeches(p, s_attribute_name = "who")[[4]]

read(BE_lda, p, no_token = 150)

## End(Not run)

PolMine/polmineR.topics documentation built on March 6, 2020, 6:03 p.m.