% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lexical_analysis.R
\name{extract_keywords_keyness}
\alias{extract_keywords_keyness}
\title{Extract Keywords Using Statistical Keyness}
\usage{
extract_keywords_keyness(
  dfm,
  target,
  top_n = 20,
  measure = "lr",
  min_count = 0
)
}
\arguments{
\item{dfm}{A quanteda dfm object}

\item{target}{Target document indices or logical vector}

\item{top_n}{Number of top keywords to extract (default: 20)}

\item{measure}{Keyness measure: "lr" (log-likelihood G-squared), "chi2",
"exact" (Fisher's exact odds ratio), or "pmi" (default: "lr")}

\item{min_count}{Minimum total term frequency before computing keyness
(default: 0, no pruning)}
}
\value{
Data frame with columns: Keyword, Keyness_Score
}
\description{
Extracts distinctive keywords by comparing document groups using log-likelihood ratio (G-squared).
}
\examples{
\donttest{
abstracts <- TextAnalysisR::SpecialEduTech$abstract[1:10]
dfm_object <- quanteda::dfm(quanteda::tokens(quanteda::corpus(abstracts)))
keywords <- extract_keywords_keyness(dfm_object, target = 1)
print(keywords)
}
}
\concept{lexical}
