% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/semantic_analysis.R
\name{calculate_similarity_robust}
\alias{calculate_similarity_robust}
\title{Calculate Document Similarity with Fallbacks}
\usage{
calculate_similarity_robust(
  texts,
  method = "embeddings",
  embedding_model = "all-MiniLM-L6-v2",
  cache_embeddings = TRUE,
  min_word_length = 3,
  doc_names = NULL
)
}
\arguments{
\item{texts}{Character vector of texts}

\item{method}{Similarity method ("embeddings" or "jaccard")}

\item{embedding_model}{Model name for embeddings (default: "all-MiniLM-L6-v2")}

\item{cache_embeddings}{Logical, cache embeddings (default: TRUE)}

\item{min_word_length}{Minimum word length for Jaccard (default: 3)}

\item{doc_names}{Optional document names}
}
\value{
List containing similarity matrix, method used, embeddings, and diagnostics
}
\description{
Calculates document similarity with fallback methods and diagnostics.
Attempts embeddings first, falls back to Jaccard similarity if needed.
}
\examples{
if (interactive()) {
  abstracts <- TextAnalysisR::SpecialEduTech$abstract[1:5]
  similarity_result <- calculate_similarity_robust(abstracts)
  print(similarity_result$similarity_matrix)
  print(similarity_result$diagnostics)
}
}
\concept{semantic}
