% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lexical_analysis.R
\name{extract_keywords_tfidf}
\alias{extract_keywords_tfidf}
\title{Extract Keywords Using TF-IDF}
\usage{
extract_keywords_tfidf(dfm, top_n = 20, normalize = FALSE)
}
\arguments{
\item{dfm}{A quanteda dfm object}

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

\item{normalize}{Logical, whether to normalize TF-IDF scores to 0-1 range (default: FALSE)}
}
\value{
Data frame with columns: Keyword, TF_IDF_Score, Frequency
}
\description{
Extracts top keywords from a document-feature matrix using TF-IDF weighting.
Uses quanteda's default scheme (raw term counts, base-10 idf), which
differs from tidytext's proportion-based tf; rankings favor terms in
longer documents.
}
\examples{
\donttest{
  library(quanteda)
  corp <- corpus(c("text analysis", "data mining", "text mining"))
  dfm_obj <- dfm(tokens(corp))
  keywords <- extract_keywords_tfidf(dfm_obj, top_n = 5)
  print(keywords)
}
}
\concept{lexical}
