update
This commit is contained in:
@@ -388,6 +388,21 @@ def crawl_rss_feed(feed_url, feed_name, feed_category='general', max_articles=10
|
||||
print(f" ⚠ Summarization failed: {summary_result['error']}")
|
||||
failed_summaries += 1
|
||||
|
||||
# Extract keywords for personalization
|
||||
keywords_result = None
|
||||
if Config.OLLAMA_ENABLED and summary_result and summary_result['success']:
|
||||
print(f" 🔑 Extracting keywords...")
|
||||
keywords_result = ollama_client.extract_keywords(
|
||||
original_title,
|
||||
summary_result['summary'],
|
||||
max_keywords=5
|
||||
)
|
||||
|
||||
if keywords_result['success']:
|
||||
print(f" ✓ Keywords: {', '.join(keywords_result['keywords'])} ({keywords_result['duration']:.1f}s)")
|
||||
else:
|
||||
print(f" ⚠ Keyword extraction failed: {keywords_result['error']}")
|
||||
|
||||
# Prepare document
|
||||
article_doc = {
|
||||
'title': original_title,
|
||||
@@ -396,6 +411,7 @@ def crawl_rss_feed(feed_url, feed_name, feed_category='general', max_articles=10
|
||||
'link': article_url,
|
||||
'content': article_data.get('content', ''), # Full article content
|
||||
'summary': summary_result['summary'] if summary_result and summary_result['success'] else None,
|
||||
'keywords': keywords_result['keywords'] if keywords_result and keywords_result['success'] else [],
|
||||
'word_count': article_data.get('word_count', 0),
|
||||
'summary_word_count': summary_result['summary_word_count'] if summary_result and summary_result['success'] else None,
|
||||
'source': feed_name,
|
||||
|
||||
Reference in New Issue
Block a user