王柏鈞
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee
  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- type: slide theme: solarized transition: slide --- # 設計可靠的AI知識庫 --- ## Hi 我是June ![image](https://hackmd.io/_uploads/ryJwOD15C.png) - 聖杰國際股份有限公司 電控工程師 - AI4kids 共同創辦人 - Cupoy 特聘講師 - 派斯客 業界顧問 - 台灣人工智慧學校 AI工程師 - 亞達科技 AI工程師 --- 今天聽完分享會得到的內容 1. 什麼是RAG 2. RAG怎麼將知識擷取到知識庫 3. RAG怎麼從知識庫中找到相關資料 4. RAG怎麼幫助LLM回答問題 5. 設計謹慎的知識庫的幾個關鍵 --- # 什麼是RAG --- ![image](https://hackmd.io/_uploads/SyJjHvy5A.png) --- ![image](https://hackmd.io/_uploads/SyH2vIk5C.png) RAG就是LLM可以參考的一本筆記本。當我們跟GPT或其他LLM交談時,提高回答的表現。 --- # 問題1: ## 筆記怎麼寫的 aka. RAG怎麼將知識擷取到知識庫 --- 1. 先獲得文字內容 2. 將內容根據字元切分成Chunk 3. 產生Embedding(嵌入) 4. 存入資料庫 ![image](https://hackmd.io/_uploads/SyebtP190.png) --- Embedding ![image](https://hackmd.io/_uploads/r1wYtDJc0.png) --- ## 圖片和表格會發生什麼事? --- 以Ollama和大多RAG工具來看,會直接被忽略掉 ![image](https://hackmd.io/_uploads/BkXq5P150.png) --- 但並不是完全沒辦法處理,例如我們可以用多模態模型來處理圖片 ![image](https://hackmd.io/_uploads/S1QzjwJcC.png) - [利用LangChain 實作多模態模型的RAG...]() - [Langchain Multi-modal RAG]() --- 一個常見迷思: RAG的嵌入也來自GPT4等大語言模型 ![image](https://hackmd.io/_uploads/S1Xynvy9C.png) --- 實際上,我們只是需要內容與嵌入互相對應,所以用相對簡單的Bert等就可以了。但確實可以用GPT或其他LLM來進行,並獲得語意上更可靠的嵌入(但會貴的嚇人)。或者針對圖像型資料,才特別選擇用GPT4o來產生嵌入。 --- # 問題2 ## 怎麼找到相關內容? aka. RAG怎麼從知識庫中找到相關資料 --- 這個問題有關檢索方法,也就是到底怎麼找到想要的資料 1. 簡單方案 - 計算嵌入之間的距離(餘弦相似度等) 2. 複雜方案 - Graph或其他資料結構樹 --- # 問題3 ## 如何利用搜索到的相關內容? aka. RAG怎麼幫助LLM回答問題 --- 如何利用搜索到的相關內容 ? ![image](https://hackmd.io/_uploads/rkVmhy-5R.png) 把搜索到的內容整合到用戶訊息裡面,一起送給LLM做回答。 --- # RAG的效果 ![image](https://hackmd.io/_uploads/HJ4JE1ZcA.png) ###### [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://arxiv.org/pdf/2005.11401) --- ## RAG就是創建數位化的第二大腦 - 一個筆記本: - 擷取、檢索、儲存 - 第二大腦: - 擷取、檢索、儲存、轉化 - 轉化指的是提取資料,並轉換成資訊。這就是語言模型的威力 --- # Review 1. 什麼是RAG 2. RAG怎麼將知識擷取到知識庫 3. RAG怎麼從知識庫中找到相關資料 4. RAG怎麼幫助LLM回答問題 5. 設計謹慎的知識庫的幾個關鍵 --- # 如何設計謹慎的AI知識庫 --- ## Garbage in Garbage out --- ## 準則 1. (開始之前)設定適合公司的審核標準,確保回應內容的規範,輸入資料的整理原則 2. (當開始建立知識庫)對每一份新的資料,設立負責人,對知識庫的內容編寫回應內容的允許範疇。(例如: 客服機器人回應內容不能超出現有客服回應資料範例中) --- 3. (當開始建立知識庫)工程師建立合理的資料擷取路徑,將新資料納入知識庫。 4. (新資料開始推論前)工程師建立Parser,確保輸出內容符合公司的標準,以及該新資料由負責人訂立的範疇。 5. (推論)上線後透過評分機制收集回應,或跟付費的高階LLM對談,並收集回饋 6. (維護)持續更新、管理知識庫。刪除廢、舊、重複知識 --- # 最大挑戰 ## 範疇與審核標準定義 --- ## 挑戰1: 關鍵資訊萃取 - 如何萃取到重要的資訊? - 如何確保到的資訊是正確的? --- ## 混合結構和非結構化資料 ![image](https://hackmd.io/_uploads/BJ-DEOy5A.png) --- 用以產生結構化資料的AI - LayoutLM家族 ![image](https://hackmd.io/_uploads/S1wa7uk50.png) --- ## 使用LLM Agent從資料庫中存取準確無誤的資訊 ##### LLM Agent還是LLM,但他透過跟運算環境連結,並多上了任務規劃和任務執行的能力。簡單的說,他現在不只能建議你做什麼,還能直接幫你做! ![image](https://hackmd.io/_uploads/rkeQH_1cR.png) --- ## 挑戰2: 圖文混合 ![image](https://hackmd.io/_uploads/HkcKMOkqA.png) --- 如何解決圖文混合問題 1. 使用CLIP家族產生嵌入(Local) 2. 使用GPT4理解圖片產生嵌入(Recommend) --- # 挑戰3: 正規化回應 ## Layout Parser ![image](https://hackmd.io/_uploads/rJjlwdycA.png) --- ## 挑戰4: 持續更新 ###### 對RAG知識庫來說,必要且最大的支出就是更新知識庫。特別是在專業領域,或需要語言工程師參與的場景,例如建立Question-Answer的對應,或是醫療或法律相關知識是涉及到案例或臨床資料。 如何將使用者的問題與回應收入知識庫 - 評分 - 使用高階語言模型產生 --- ## No-code 關鍵知識管理知識庫 - No-code 關鍵資訊萃取器 - 混合結構與非結構資料的知識庫 - 優化的Layout Parser --- # 謝謝聆聽!

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully