💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Fix issues with graph.infertopics, closes #516
davidmezzettid8be34f28e0a
diff --git a/src/python/txtai/graph/base.py b/src/python/txtai/graph/base.pyindex f978ec25..161b46f6 100644--- a/src/python/txtai/graph/base.py+++ b/src/python/txtai/graph/base.py@@ -555,14 +555,14 @@ class Graph:ids = self.edges(uid)# Infer topic- topic = Counter(self.attribute(x, "topic") for x in ids).most_common(1)[0][0]+ topic = Counter(self.attribute(x, "topic") for x in ids).most_common(1)[0][0] if ids else Noneif topic:# Add id to topic list and set topic attributeself.topics[topic].append(uid)self.addattribute(uid, "topic", topic)# Set topic rank- self.addattribute(uid, "topicrank", len(self.topics[topic]))+ self.addattribute(uid, "topicrank", len(self.topics[topic]) - 1)# Infer categorycategory = Counter(self.attribute(x, "category") for x in ids).most_common(1)[0][0]