mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-06-19 04:03:45 +08:00
Previously, sentiment and emotion classification only used configured classification model endpoints, which blocked sites that could not run those models. This change lets admins choose agent-backed LLM classifiers for sentiment and emotion while storing results under stable model keys so LLM changes do not force historic reclassification.
15 lines
482 B
Ruby
Vendored
15 lines
482 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module DiscourseAi
|
|
module Sentiment
|
|
module Constants
|
|
SENTIMENT_MODEL = "cardiffnlp/twitter-roberta-base-sentiment-latest"
|
|
EMOTION_MODEL = "SamLowe/roberta-base-go_emotions"
|
|
SENTIMENT_AGENT_MODEL = "discourse-ai/sentiment-agent"
|
|
EMOTION_AGENT_MODEL = "discourse-ai/emotion-agent"
|
|
CLASSIFICATION_MODEL_STRATEGY = "classification_model"
|
|
AGENT_STRATEGY = "agent"
|
|
SENTIMENT_THRESHOLD = 0.6
|
|
end
|
|
end
|
|
end
|