Home LangChain笔记
Post
Cancel

LangChain笔记

Models

Chat Models

  • Chat Messages
  • Batch Messages
  • Prompt Templates
    • With one or more MessagePromptTemplates you can build a ChatPromptTemplate
  • With Streaming

Components

Text

Chat Message

Documents

Use Case

Summarization

⚠️5 Levels Of Summarization

  1. Summarize a couple sentences - Basic Prompt
  2. Summarize a couple paragraphs - Prompt Templates
  3. Summarize a couple pages - Map Reduce
  4. Summarize an entire book - Best Representation Vectors
  5. Summarize an unknown amount of text - Agents

Google Driver Loader

资料

Youtube Loader

Use Case

  • Simple Videos Summary
  • Long Videos Summary
  • Multiple Videos Summary

Question A 300 Page Book

Workaround OpenAI’s Token Limit With Chain Types

  • 场景介绍:link

  • 展示提问过程

    1
    2
    
    chain = load_qa_chain(llm, chain_type="map_rerank", verbose=True, return_intermediate_steps=True)
    # 四种类型的 prompt 值得参考,定制模板可以用上
    

stuff

map reduce

map reduce图解

refine

refine chain 图解

map rerank

map rerank

Clean and Standardize Data

  • 💡use StructuredOutputParser to Standardize data
  • ⚠️ 使用 ChatPromptTemplate, 需要了解一下几个 promptTemplate 之间的区别

Connect OpenAI To +5,000 Tools

  • 使用 [ZapierAutomation that moves you forward](https://zapier.com/)

Extract Structured Data From Text: Expert Mode (Using Kor)

Working With Call or Video Transcripts

  • 预先设置好的 Prompt 可以让 GPT 有选择性地回答问题

Instructing LLMs To Match Tone

jupyter 使用

安装虚拟环境

1
2
3
4
5
conda create --name py3-ml python=3.6
conda install ipykernel

source activate py3-ml # or conda activate py3-ml
python -m ipykernel install --user --name py3-ml

相关应用

AutoGPT

测试 case: 查询合约地址归属

  • 执行命令
1
./run.sh 
  • Prompt Demo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
I would like to know which protocols the following contract addresses belong to. you can use etherscan, google search to find something new for this jobs, List of contract addresses:
###
chain,contract_address
ThunderCore,	0xabd380327fe66724ffda91a87c772fb8d00be488
Ethereum,	0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9
Ethereum,	0x398ec7346dcd622edc5ae82352f02be94c62d119
Ethereum,	0x633c23fc727e8afd3546d0cf86c8644f0fff16a6
Ethereum,	0x2f60c3eb259d63dcca81fde7eaa216d9983d7c60
ThunderCore,	0xf4d73326c13a4fc5fd7a064217e12780e9bd62c3
Ethereum,	0x87870bca3f3fd6335c3f4ce8392d69350b4fa4e2
BNB Chain,	0xcd5383fad43aabefa54710c77431dfa7bed95e18
BNB Chain,	0xb082de4b0a08ce67dc70027c52fe651a2857cc4e
BNB Chain,	0x0e556b87bfcc59fa67bb9fe0e2787bdec370076f
BNB Chain,	0x79310453a287e7e3438132a6d23e032f8f1ac1e0
BNB Chain,	0x4002cd785dc9b89f9493f7b089768ee669d81057
###

相关资料

This post is licensed under CC BY 4.0 by the author.

区块链数据解析(6):NFT

-

Comments powered by Disqus.