{"id":53714,"date":"2025-02-16T17:56:23","date_gmt":"2025-02-16T09:56:23","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53714\/"},"modified":"2025-02-16T17:56:23","modified_gmt":"2025-02-16T09:56:23","slug":"deepseek-r1%e9%a9%b1%e5%8a%a8%e7%9a%84%e9%87%91%e8%9e%8d%e5%88%86%e6%9e%90%e5%b8%88","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53714\/","title":{"rendered":"DeepSeek-R1\u9a71\u52a8\u7684\u91d1\u878d\u5206\u6790\u5e08"},"content":{"rendered":"<p>\u5728\u5f53\u4eca\u5feb\u8282\u594f\u7684\u91d1\u878d\u5e02\u573a\u4e2d\uff0c\u83b7\u53d6\u51c6\u786e\u53ca\u65f6\u7684\u4fe1\u606f\u5bf9\u4e8e\u505a\u51fa\u660e\u667a\u7684\u6295\u8d44\u51b3\u7b56\u81f3\u5173\u91cd\u8981\u3002\u60f3\u8c61\u4e00\u4e0b\uff0c\u4e00\u4f4d\u4eba\u5de5\u667a\u80fd\u91d1\u878d\u5206\u6790\u5e08\u80fd\u591f\u5206\u6790\u80a1\u7968\u6570\u636e\u3001\u63d0\u53d6\u76f8\u5173\u65b0\u95fb\u89c1\u89e3\u5e76\u7efc\u5408\u53ef\u884c\u7684\u5efa\u8bae\u2014\u2014\u6240\u6709\u8fd9\u4e9b\u90fd\u662f\u5b9e\u65f6\u7684\u3002<\/p>\n<p>\u5728\u4e0a\u4e00\u8282\u4e2d\uff0c\u6211\u4eec\u6784\u5efa\u4e86\u4e00\u4e2a\u80fd\u591f\u5206\u6790\u80a1\u7968\u6570\u636e\u7684\u91d1\u878d\u5206\u6790\u5e08\u3002\u73b0\u5728\uff0c\u6211\u4eec\u5c06\u4e13\u6ce8\u4e8e\u521b\u5efa\u4e00\u4e2a\u4e13\u95e8\u7528\u4e8e\u63d0\u53d6\u76f8\u5173\u65b0\u95fb\u89c1\u89e3\u7684\u4ee3\u7406\u3002\u8be5\u4ee3\u7406\u5c06\u5229\u7528 Yahoo Finance \u6765\u83b7\u53d6\u4e0e\u80a1\u7968\u76f8\u5173\u7684\u65b0\u95fb\uff0c\u5229\u7528 MarkItDown \u8fdb\u884c\u7f51\u9875\u6293\u53d6\uff0c\u5229\u7528 DeepSeek-R1 \u8fdb\u884c llm \u5b66\u4e60\uff0c\u5229\u7528 LangChain \u6765\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u3002\u901a\u8fc7\u5229\u7528\u8fd9\u4e9b\u5de5\u5177\uff0c\u6211\u4eec\u65e8\u5728\u5f00\u53d1\u4e00\u79cd\u7b80\u5316\u7684\u5de5\u4f5c\u6d41\u7a0b\uff0c\u63d0\u4f9b\u5168\u9762\u7684\u5e02\u573a\u6d1e\u5bdf\uff0c\u4f7f\u6295\u8d44\u8005\u80fd\u591f\u505a\u51fa\u660e\u667a\u7684\u51b3\u7b56\u3002<\/p>\n<p>\u8fd9\u4e2a\u65b0\u95fb\u6d1e\u5bdf\u4ee3\u7406\u5c06\u5b9e\u73b0\uff1a<\/p>\n<ul>\n<li>\u83b7\u53d6\u65b0\u95fb URL\uff1aYahoo Finance \u6536\u96c6\u6240\u63d0\u4f9b\u80a1\u7968\u7684\u76f8\u5173\u65b0\u95fb URL\u3002<\/li>\n<li>\u63d0\u53d6\u65b0\u95fb\u5185\u5bb9\uff1a\u5229\u7528 Microsoft \u7684 MarkItDown \u4ece\u83b7\u53d6\u7684 URL \u4e2d\u63d0\u53d6\u6240\u6709\u6587\u672c\u3002<\/li>\n<li>\u5206\u6790\u548c\u603b\u7ed3\uff1a\u5229\u7528 DeepSeek R1 \u5bf9\u63d0\u53d6\u7684\u5185\u5bb9\u8fdb\u884c\u6df1\u5165\u7684\u63a8\u7406\u548c\u5206\u6790\u3002<\/li>\n<\/ul>\n<p>\u6b64\u9879\u76ee\u4e2d\u4f7f\u7528\u7684\u6240\u6709\u5de5\u5177\u548c\u5e93\u90fd\u662f\u5f00\u6e90\u7684\uff0c\u53ef\u514d\u8d39\u4f7f\u7528\u3002\u5b83\u4eec\u4e0d\u9700\u8981 API \u5bc6\u94a5\uff0c\u786e\u4fdd\u5f00\u53d1\u4eba\u5458\u548c\u7231\u597d\u8005\u7684\u65e0\u7f1d\u8bbe\u7f6e\uff1a<\/p>\n<ul>\n<li>Yahoo Finance\uff1a\u7528\u4e8e\u83b7\u53d6\u65b0\u95fb URL \u548c\u6536\u96c6\u4e0e\u80a1\u7968\u76f8\u5173\u7684\u6570\u636e\u3002<\/li>\n<li>\uff1a\u4e00\u79cd\u7528\u4e8e\u4ece\u65b0\u95fb URL \u4e2d\u63d0\u53d6\u6587\u672c\u5185\u5bb9\u7684 Microsoft \u5de5\u5177\u3002<\/li>\n<li>LangChain\uff1a\u4e00\u4e2a\u7531\u8bed\u8a00\u6a21\u578b\u9a71\u52a8\u7684\u5e94\u7528\u7a0b\u5e8f\u6784\u5efa\u6846\u67b6\u3002<\/li>\n<li>\uff1a\u4e00\u79cd\u4ee5\u667a\u80fd\u63a8\u7406\u548c\u7ed3\u6784\u5316\u8d22\u52a1\u6d1e\u5bdf\u800c\u95fb\u540d\u7684\u5f00\u6e90 AI \u6a21\u578b\u3002\u5728\u8fd9\u4e2a\u9879\u76ee\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528 15 \u4ebf\u53c2\u6570\u7248\u672c\u2014\u2014\u4e00\u4e2a\u7d27\u51d1\u4f46\u529f\u80fd\u5f3a\u5927\u7684\u6a21\u578b\uff0c\u975e\u5e38\u9002\u5408\u5177\u6709 8GB RAM \u4e14\u6ca1\u6709 NVIDIA \u663e\u5361\u7684\u7cfb\u7edf\u3002<\/li>\n<li>Python \u5e93\uff1a\u5305\u62ec pandas\u3001dotenv \u548c datetime\uff0c\u7528\u4e8e\u6570\u636e\u5904\u7406\u548c\u73af\u5883\u8bbe\u7f6e\u3002<\/li>\n<\/ul>\n<p>\u672c\u6559\u7a0b\u7684\u76f8\u5173\u4ee3\u7801\u53ef\u4ee5\u4ece\u83b7\u5f97\u3002<\/p>\n<h2>1\u3001\u8bbe\u7f6e\u73af\u5883<\/h2>\n<p>\u9996\u5148\u5b89\u88c5\u6240\u9700\u7684\u5e93\uff1a<\/p>\n<pre><code>pip install -U langgraph langchain langchain-ollama pandas python-dotenv yfinance markitdown\n<\/code><\/pre>\n<h2>2\u3001\u83b7\u53d6\u80a1\u7968\u65b0\u95fb<\/h2>\n<p>\u6b64\u6b65\u9aa4\u6d89\u53ca\u4f7f\u7528 Yahoo Finance \u68c0\u7d22\u4e0e\u7279\u5b9a\u80a1\u7968\u76f8\u5173\u7684\u6700\u65b0\u65b0\u95fb\u6587\u7ae0\u3002<\/p>\n<p><code>get_news(stock)<\/code> \u51fd\u6570\u4f7f\u7528 Yahoo Finance \u68c0\u7d22\u4e0e\u6307\u5b9a\u80a1\u7968\u76f8\u5173\u7684\u65b0\u95fb\u6587\u7ae0\u3002\u5b83\u8fc7\u6ee4\u65b0\u95fb\u9879\u76ee\u4ee5\u4ec5\u5305\u542b\u5f52\u7c7b\u4e3a\u6545\u4e8b\uff08 <code>contentType='STORY'<\/code>\uff09\u7684\u65b0\u95fb\u9879\u76ee\uff0c\u5e76\u63d0\u53d6\u6807\u9898\u3001\u6458\u8981\u3001URL \u548c\u53d1\u5e03\u65e5\u671f\u7b49\u5173\u952e\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<pre><code>import yfinance as yf\nimport pandas as pd\n\ndef get_news(stock: str) -&gt; list:\n    \"\"\"\n    Fetch relevant news articles for a given stock ticker.\n\n    Parameters:\n    - stock (str): The stock ticker symbol.\n\n    Returns:\n    - list: A list of dictionaries containing title, summary, URL, and publication date of relevant news articles.\n    \"\"\"\n    try:\n        # Fetch the ticker object and retrieve its news\n        ticker = yf.Ticker(stock)\n        news = ticker.news\n\n        if not news:\n            print(f\"No news found for {stock}.\")\n            return []\n\n        # Filter news with contentType='STORY'\n        relevant_news = [\n            item for item in news if item.get('content', {}).get('contentType') == 'STORY'\n        ]\n\n        all_news = []\n        for i, item in enumerate(relevant_news):\n            try:\n                content = item.get('content', {})\n                current_news = {\n                    'title': content.get('title'),\n                    'summary': content.get('summary'),\n                    'url': content.get('canonicalUrl', {}).get('url'),\n                    'pubdate': content.get('pubDate', '').split('T')[0],\n                }\n                all_news.append(current_news)\n            except Exception as e:\n                print(f\"Error processing news {i}: {e}\")\n                continue\n\n        return all_news\n\n    except Exception as e:\n        print(f\"An error occurred while fetching news for {stock}: {e}\")\n        return None\n\n\n# news = get_news('SOFI')\n# news[0]\n# {'title': \"This Cathie Wood Fintech Stock Just Hit a New 52-Week High -- but I'm Not Selling a Single Share\",\n# 'summary': \"Cathie Wood's ARK Invest offers several popular exchange-traded funds (ETFs), and they tend to be rather concentrated, with all of them holding three dozen or fewer stocks.  The banking innovator is the sixth-largest holding in the ARK Fintech Innovation ETF (NYSEMKT: ARKF), making up 5% of the fund's total assets.  You'll also find about $95 million worth of SoFi stock in the flagship ARK Innovation ETF (NYSEMKT: ARKK), and it's also worth noting that the SoFi app is the exclusive distribution partner for the ARK Venture Fund (NASDAQMUTFUND: ARKVX), which allows investors to get exposure to companies like SpaceX and OpenAI before their initial public offering.\",\n# 'url': 'https:\/\/www.fool.com\/investing\/2025\/01\/25\/this-cathie-wood-fintech-stock-just-hit-a-new-52-w\/?source=eptyholnk0000202&amp;utm_source=yahoo-host-full&amp;utm_medium=feed&amp;utm_campaign=article&amp;referring_guid=8eb186e2-b253-418b-b12f-4c58f97e79b2',\n# 'pubdate': '2025-01-25'}<\/code><\/pre>\n<h2>3\u3001\u63d0\u53d6\u5e72\u51c0\u7684\u65b0\u95fb\u5185\u5bb9<\/h2>\n<p>\u4e00\u65e6\u6211\u4eec\u4ece Yahoo Finance \u83b7\u5f97\u4e86\u76f8\u5173\u7684\u65b0\u95fb URL\uff0c\u4e0b\u4e00\u6b65\u5c31\u662f\u4ece\u8fd9\u4e9b\u94fe\u63a5\u4e2d\u63d0\u53d6\u5e72\u51c0\u4e14\u53ef\u8bfb\u7684\u6587\u672c\u5185\u5bb9\u3002\u539f\u59cb\u7f51\u9875\u5185\u5bb9\u901a\u5e38\u5305\u542b\u4e0d\u5fc5\u8981\u7684\u5143\u7d20\uff0c\u4f8b\u5982\u94fe\u63a5\u3001\u7279\u6b8a\u5b57\u7b26\u548c\u683c\u5f0f\u8fd9\u4f1a\u963b\u788d\u5206\u6790\u3002\u5728\u6b64\u6b65\u9aa4\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528 MarkItDown\uff0c\u8fd9\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u4ece\u7f51\u9875\u4e2d\u63d0\u53d6\u6587\u672c\u7684\u5e93\uff0c\u5e76\u6e05\u7406\u8f93\u51fa\u4ee5\u63d0\u9ad8\u53ef\u7528\u6027\u3002<\/p>\n<pre><code>from markitdown import MarkItDown\nimport requests\nimport re\n\n# Create a session for reliable requests\nsession = requests.Session()\nsession.headers.update({'User-Agent': 'python-requests\/2.32.3', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*\/*', 'Connection': 'keep-alive'})\n\n# Initialize MarkItDown\nmd = MarkItDown(requests_session=session)\n\n# Function to clean unnecessary links and special characters\ndef remove_links(text):\n    text = re.sub(r'http\\S+', '', text)  # Remove URLs\n    text = re.sub(r'\\[.*?\\]', '', text)  # Remove markdown-style links\n    text = re.sub(r'[#*()+\\-\\n]', '', text)  # Remove special characters\n    text = re.sub(r'\/\\S*', '', text)  # Remove slashes\n    text = re.sub(r'  ', '', text)  # Remove double spaces\n    return text\n\n# Function to extract news content from a URL\ndef extract_news(link):\n    # Use MarkItDown to extract the content\n    information_to_extract = md.convert(link)\n    text_title = information_to_extract.title.strip()  # Extract title\n    text_content = information_to_extract.text_content.strip()  # Extract main content\n    \n    # Clean and combine the title and content\n    return text_title + '\\n' + remove_links(text_content)\n\n\n# extract_news(news[1]['url'])\n\n# 'This Cathie Wood Fintech Stock Just Hit a New 52-Week High --......<\/code><\/pre>\n<h2>4\u3001\u63d0\u53d6\u5b8c\u6574\u65b0\u95fb\u6587\u7ae0<\/h2>\n<p>\u5728\u6b64\u6b65\u9aa4\u4e2d\uff0c\u6211\u4eec\u57fa\u4e8e\u4e4b\u524d\u7684\u529f\u80fd\uff0c\u96c6\u6210\u4e86\u4e00\u79cd\u65b9\u6cd5\uff0c\u7528\u4e8e\u83b7\u53d6\u548c\u63d0\u53d6\u7ed9\u5b9a\u80a1\u7968\u7684\u5b8c\u6574\u65b0\u95fb\u6587\u7ae0\u3002\u6807\u9898\u6216\u6458\u8981\u901a\u5e38\u7f3a\u4e4f\u6709\u610f\u4e49\u7684\u5206\u6790\u6240\u9700\u7684\u6df1\u5ea6\u3002\u901a\u8fc7\u63d0\u53d6\u65b0\u95fb\u6587\u7ae0\u7684\u5168\u90e8\u5185\u5bb9\uff0c\u6211\u4eec\u53ef\u4ee5\u63d0\u4f9b\u66f4\u4e30\u5bcc\u7684\u89c1\u89e3\uff0c\u53d1\u73b0\u66f4\u591a\u4fe1\u606f\uff0c\u5e76\u4e3a\u8d22\u52a1\u51b3\u7b56\u63d0\u4f9b\u8be6\u7ec6\u7684\u7406\u7531\u3002<\/p>\n<pre><code>def extract_full_news(stock: str) -&gt; list:\n    \"\"\"\n    Fetch full news articles.\n\n    Parameters:\n    - stock (str): The stock ticker symbol.\n\n    Returns:\n    - list: A list of dictionaries containing full_news of relevant news articles.\n    \"\"\"\n    # Step 1: Fetch news using the get_news function\n    news = get_news(stock)\n    \n    # Step 2: Iterate through each news article\n    for i, item in enumerate(news):\n        try:\n            # Step 3: Extract the full news content using the URL\n            full_news = extract_news(item['url'])\n            item['full_news'] = full_news\n        except Exception as e:\n            # Step 4: Handle errors gracefully\n            print(f\"Error extracting news {i}: {e}\")\n            continue\n\n    # Step 5: Return the list of enriched news articles\n    return news<\/code><\/pre>\n<h2>5\u3001\u6267\u884c\u60c5\u7eea\u5206\u6790\u5e76\u751f\u6210\u6295\u8d44\u5efa\u8bae<\/h2>\n<p>\u5728\u524d\u9762\u7684\u6b65\u9aa4\u4e2d\uff0c\u6211\u4eec\u4e30\u5bcc\u4e86\u5b8c\u6574\u7684\u65b0\u95fb\u6587\u7ae0\uff0c\u5728\u6b64\u6b65\u9aa4\u4e2d\uff0c\u6211\u4eec\u5229\u7528 LangChain \u548c DeepSeek-R1 \u5206\u6790\u63d0\u53d6\u7684\u65b0\u95fb\u6587\u7ae0\u3002\u8fd9\u6d89\u53ca\u8bc4\u4f30\u6bcf\u7bc7\u6587\u7ae0\u7684\u60c5\u7eea\u5e76\u751f\u6210\u5305\u542b\u6295\u8d44\u5efa\u8bae\u7684\u7efc\u5408\u6458\u8981\u3002<\/p>\n<pre><code>from langchain_core.prompts import ChatPromptTemplate\nfrom langchain_ollama.llms import OllamaLLM\n\n# Step 1: Initialize the LLM with DeepSeek-R1 model\nllm = OllamaLLM(model=\"deepseek-r1:1.5b\") # can downlaod bigger model\n# https:\/\/ollama.com\/library\/deepseek-r1:1.5b\n\n# Step 2: Define the prompt template\nPROMPT = \"\"\"\nYou are an expert financial analyst. I will provide you with a list of news articles related to a specific stock. Your tasks are as follows:\n\n1. **Sentiment Analysis:**\n   - For each news article, evaluate its sentiment as 'Positive', 'Negative', or 'Neutral'.\n   - Present your evaluation in a dictionary format where each key is the article's title, and the corresponding value is the assessed sentiment.\n\n2. **Comprehensive Summary and Investment Recommendation:**\n   - After analyzing all the articles, provide a concise summary that encapsulates the overall sentiment and key points from the news.\n   - Based on this summary, advise whether investing in the stock is advisable at this time, supporting your recommendation with reasons derived from the news analysis.\n\n**News Articles:**  \n\n{articles}\n\n**Output Format:**  \n\n1. **Sentiment Analysis Dictionary:**  \n\n   ```json\n   {{\n       \"Article Title 1\": \"Positive\",\n       \"Article Title 2\": \"Negative\",\n       \"Article Title 3\": \"Neutral\",\n       ...\n   }}\n2. Summary: [Your summary here]\n3. Investment Recommendation: [Your recommendation here]\n\"\"\"\n\n# Step 3: Create a ChatPromptTemplate\nprompt_template = ChatPromptTemplate.from_messages(\n    [\n        ('system', PROMPT),\n        ('human', \"I would like to analyze the news articles related to the stock {stock}.\")\n    ]\n)\n\n# Step 4: Create a pipeline with LangGraph for orchestration\nstructure = prompt_template | llm\n\n# Step 5: Invoke the pipeline with the news articles and stock data\nresult = structure.invoke(\n    {\n        \"stock\": stock,\n        \"articles\": [fn['full_news'] for fn in full_news]  # Pass the full news content\n\npprint(result)<\/code><\/pre>\n<p>\u8f93\u51fa\u5982\u4e0b\uff1a<\/p>\n<pre><code>Thinking \n\n* Alright, so I need to analyze some news articles about the stock SOFI.\n  First, let me look at each article provided and try to extract relevant\n  information.\n\n* Starting with Mike Bailey's CNBC interview from January 23, 2025. He\n  mentioned that the macroeconomic conditions in the U.S., especially job\n  growth beyond 2025, are positive. So, I can note that he's confident large\n  caps outperform small caps for long-term growth. That seems like a key\n  point.\n\n* Looking at SOFI's performance: they had a 12.5% return over 30 days from\n  $15.63 to $17.59. Their revenue grew by 30%, mainly due to two segments\n  increasing their market share. The customer base is over 10 million, and\n  they've raised funding of $73 billion in loans.\n\n* Next, I should check if there's any conflict between Bailey's optimism and\n  SOFI's positive stock performance. His confidence in large caps being better\n  positioned for earnings growth might suggest that while he thinks large caps\n  are great for earning money, the real challenge is whether those large caps\n  can deliver on their promises within the same timeframe as his\n  expectations.\n\n* I also need to consider if there are any conflicting viewpoints or if one\n  article supports the other. It seems both points align:Bailey's confidence\n  in large caps and SOFI's positive performance support that perspective.\n\n* So, putting it all together, I can create a sentiment analysis dictionary \n  reflecting this alignment. I'll summarize the key points about his optimism \n  and the stock's positive performance, then recommend an investment decision\n  based on these supporting factors.<\/code><\/pre>\n<pre><code>Summary\n   Mike Bailey, FBB Capital Partners' director of research, expressed\n   confidence that large-cap stocks outperform small caps for long-term '\n   earnings growth. This sentiment aligns with SOFI's positive performance, \"\n   which rose 12.5% over three months and generated revenue growth driven by '\n   two financial services segments.\n\nInvestment Recommendation:\n  Invest in SOFI Technologies (NASDAQ:SOFI) due to its supportive\n  macroeconomic outlook and solid performance as a fintech company. The\n  confidence in large caps aligning with SOFI's positive returns reinforces\n  the potential for high returns within the investment timeframe.<\/code><\/pre>\n<h2>6\u3001\u7ed3\u675f\u8bed<\/h2>\n<p>\u5728\u672c\u8282\u4e2d\uff0c\u6211\u4eec\u6210\u529f\u6784\u5efa\u4e86\u4e00\u4e2a\u5b8c\u6574\u7684\u5de5\u4f5c\u6d41\uff0c\u53ef\u4ee5\u83b7\u53d6\u65b0\u95fb\u6587\u7ae0\u3001\u6267\u884c\u60c5\u7eea\u5206\u6790\u3001\u751f\u6210\u6458\u8981\u548c\u63d0\u4f9b\u6295\u8d44\u5efa\u8bae\u3002\u8be5\u7cfb\u7edf\u57fa\u4e8e\u5b9e\u65f6\u65b0\u95fb\u6570\u636e\u548c\u89c1\u89e3\uff0c\u63d0\u4f9b\u667a\u80fd\u7684\u80a1\u7968\u5206\u6790\u65b9\u6cd5\uff0c\u5e2e\u52a9\u6295\u8d44\u8005\u505a\u51fa\u66f4\u660e\u667a\u7684\u51b3\u7b56\u3002<\/p>\n<p>DeepSeek-R1 \u7684\u96c6\u6210\u663e\u8457\u589e\u5f3a\u4e86\u6211\u4eec\u91d1\u878d\u5206\u6790\u5e08\u7684\u63a8\u7406\u548c\u5206\u6790\u80fd\u529b\u3002\u901a\u8fc7\u5229\u7528 DeepSeek-R1\uff0c\u6211\u4eec\u7684\u91d1\u878d\u5206\u6790\u5e08\u53ef\u4ee5\u5904\u7406\u548c\u89e3\u91ca\u590d\u6742\u7684\u8d22\u52a1\u6570\u636e\uff0c\u63d0\u4f9b\u66f4\u51c6\u786e\u3001\u66f4\u6709\u89c1\u5730\u7684\u5206\u6790\u3002\u8fd9\u4e00\u8fdb\u6b65\u4e3a\u6295\u8d44\u8005\u63d0\u4f9b\u4e86\u4e00\u79cd\u5de5\u5177\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u81ea\u52a8\u5316\u6570\u636e\u5904\u7406\uff0c\u8fd8\u53ef\u4ee5\u63d0\u4f9b\u590d\u6742\u7684\u63a8\u7406\u6765\u4e3a\u6295\u8d44\u51b3\u7b56\u63d0\u4f9b\u4fe1\u606f\u3002<\/p>\n<p>\u5728 GitHub \u4e0a\u67e5\u770b\u5b8c\u6574\u7684\u9879\u76ee\u3002\u5206\u53c9\u5b83\uff0c\u8fdb\u884c\u5b9e\u9a8c\uff0c\u8ba9\u6211\u77e5\u9053\u4f60\u7684\u60f3\u6cd5\uff01<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5f53\u4eca\u5feb\u8282\u594f\u7684\u91d1\u878d\u5e02\u573a\u4e2d\uff0c\u83b7\u53d6\u51c6\u786e\u53ca\u65f6\u7684\u4fe1\u606f\u5bf9\u4e8e\u505a\u51fa\u660e\u667a\u7684\u6295\u8d44\u51b3\u7b56\u81f3\u5173\u91cd\u8981\u3002\u60f3\u8c61\u4e00\u4e0b\uff0c\u4e00\u4f4d\u4eba\u5de5\u667a\u80fd\u91d1\u878d\u5206\u6790\u5e08\u80fd\u591f\u5206\u6790\u80a1\u7968\u6570\u636e\u3001\u63d0\u53d6\u76f8\u5173\u65b0\u95fb\u89c1\u89e3\u5e76\u7efc\u5408\u53ef\u884c\u7684\u5efa\u8bae\u2014\u2014\u6240\u6709\u8fd9\u4e9b\u90fd\u662f\u5b9e\u65f6\u7684\u3002 \u5728\u4e0a\u4e00\u8282\u4e2d\uff0c\u6211\u4eec\u6784\u5efa\u4e86\u4e00\u4e2a\u80fd\u591f\u5206\u6790\u80a1\u7968\u6570\u636e\u7684\u91d1\u878d\u5206\u6790\u5e08\u3002\u73b0\u5728\uff0c\u6211\u4eec\u5c06\u4e13\u6ce8\u4e8e\u521b\u5efa\u4e00\u4e2a\u4e13\u95e8\u7528\u4e8e\u63d0\u53d6\u76f8\u5173\u65b0\u95fb\u89c1\u89e3\u7684\u4ee3\u7406\u3002\u8be5\u4ee3\u7406\u5c06\u5229\u7528 Yahoo Finance \u6765\u83b7\u53d6\u4e0e\u80a1\u7968\u76f8\u5173\u7684\u65b0\u95fb\uff0c\u5229\u7528 MarkItDown \u8fdb\u884c\u7f51\u9875\u6293\u53d6\uff0c\u5229\u7528 DeepSeek-R1 \u8fdb\u884c llm \u5b66\u4e60\uff0c\u5229\u7528 LangChain \u6765\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u3002\u901a\u8fc7\u5229\u7528\u8fd9\u4e9b\u5de5\u5177\uff0c\u6211\u4eec\u65e8\u5728\u5f00\u53d1\u4e00\u79cd\u7b80\u5316\u7684\u5de5\u4f5c\u6d41\u7a0b\uff0c\u63d0\u4f9b\u5168\u9762\u7684\u5e02\u573a\u6d1e\u5bdf\uff0c\u4f7f\u6295\u8d44\u8005\u80fd\u591f\u505a\u51fa\u660e\u667a\u7684\u51b3\u7b56\u3002 \u8fd9\u4e2a\u65b0\u95fb\u6d1e\u5bdf\u4ee3\u7406\u5c06\u5b9e\u73b0\uff1a \u83b7\u53d6\u65b0\u95fb URL\uff1aYahoo Finance \u6536\u96c6\u6240\u63d0\u4f9b\u80a1\u7968\u7684\u76f8\u5173\u65b0\u95fb URL\u3002 \u63d0\u53d6\u65b0\u95fb\u5185\u5bb9\uff1a\u5229\u7528 Microsoft \u7684 MarkItDown \u4ece\u83b7\u53d6\u7684 URL \u4e2d\u63d0\u53d6\u6240\u6709\u6587\u672c\u3002 \u5206\u6790\u548c\u603b\u7ed3\uff1a\u5229\u7528 DeepSeek R1 \u5bf9\u63d0\u53d6\u7684\u5185\u5bb9\u8fdb\u884c\u6df1\u5165\u7684\u63a8\u7406\u548c\u5206\u6790\u3002 \u6b64\u9879\u76ee\u4e2d\u4f7f\u7528\u7684\u6240\u6709\u5de5\u5177\u548c\u5e93\u90fd\u662f\u5f00\u6e90\u7684\uff0c\u53ef\u514d\u8d39\u4f7f\u7528\u3002\u5b83\u4eec\u4e0d\u9700\u8981 API \u5bc6\u94a5\uff0c\u786e\u4fdd\u5f00\u53d1\u4eba\u5458\u548c\u7231\u597d\u8005\u7684\u65e0\u7f1d\u8bbe\u7f6e\uff1a Yahoo Finance\uff1a\u7528\u4e8e\u83b7\u53d6\u65b0\u95fb URL \u548c\u6536\u96c6\u4e0e\u80a1\u7968\u76f8\u5173\u7684\u6570\u636e\u3002 \uff1a\u4e00\u79cd\u7528\u4e8e\u4ece\u65b0\u95fb URL \u4e2d\u63d0\u53d6\u6587\u672c\u5185\u5bb9\u7684 Microsoft \u5de5\u5177\u3002 LangChain\uff1a\u4e00\u4e2a\u7531\u8bed\u8a00\u6a21\u578b\u9a71\u52a8\u7684\u5e94\u7528\u7a0b\u5e8f\u6784\u5efa\u6846\u67b6\u3002 \uff1a\u4e00\u79cd\u4ee5\u667a\u80fd\u63a8\u7406\u548c\u7ed3\u6784\u5316\u8d22\u52a1\u6d1e\u5bdf\u800c\u95fb\u540d\u7684\u5f00\u6e90 AI \u6a21\u578b\u3002\u5728\u8fd9\u4e2a\u9879\u76ee\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528 15 \u4ebf\u53c2\u6570\u7248\u672c\u2014\u2014\u4e00\u4e2a\u7d27\u51d1\u4f46\u529f\u80fd\u5f3a\u5927\u7684\u6a21\u578b\uff0c\u975e\u5e38\u9002\u5408\u5177\u6709 8GB RAM \u4e14\u6ca1\u6709 NVIDIA \u663e\u5361\u7684\u7cfb\u7edf\u3002 Python \u5e93\uff1a\u5305\u62ec [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-53714","post","type-post","status-publish","format-standard","hentry","category-ai"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=53714"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53714\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}