17. ②特許文献からの情報抽出
17
必要性 特許文献を全部(すみからすみまで)読みたくない
利用関数 UnstructuredURLLoader
CharacterTextSplitter
Chroma
サンプル chain = RetrievalQAWithSourcesChain.from_chain_type(model,
chain_type="map_reduce", retriever=docsearch.as_retriever())
q1="この発明に記載の方法で処理できる物質を教えてください。
"
chain({"question": q1}, return_only_outputs=True)
output:
{'answer': 'Types of waste that can be processed include
normal garbage, toilet solid waste, organic waste, and small
amounts of PVC plastic containing chlorine. Glass and metal
are not melted but are recovered as completely sterilized at
the end of the process cycle for recycling.n', 'sources':
'https://patents.google.com/patent/WO2020118236A1/en,
https://patents.google.com/patent/US7998226B2/en'}
5.使えそうなもの探し(実験)
21. 21
必要性 分析の観点のアイデア出し
利用関数 LLMChain、human、AgentExecutor、ZeroShotAgent
サンプル(ポイント部分)
tools = [ Tool( name="Search", func=search.run, description="useful for when
you need to answer questions about current events" , ),
Tool( name="Human", func=human.HumanInputRun(description="useful for when you
need to ask human yes or no about questions." ) ) ]
llm_chain = LLMChain(llm=llm, prompt=prompt)
agent = ZeroShotAgent(llm_chain=llm_chain, tools=tools, verbose=True)
agent_chain = AgentExecutor.from_agent_and_tools(
agent=agent,
tools=tools,
verbose=True,
memory=memory
)
agent_chain.run(input="make an abduction.",compA="A株式会社",compB="B株式会社",technology="内視
鏡")
⑦分析仮説の作成(1/2)
問:A社とB社が技術的に**分野
で繋がっている理由について仮説を
作る
5.使えそうなもの探し(実験)
人間を道具にできる
24. 24
必要性 特許以外の関連情報を参照したい
利用関数 ConversationalRetrievalChain
KayAiRetriever
サンプル(ポイント部分)
retriever = KayAiRetriever.create(dataset_id="company", data_types=["10-K",
"10-Q","PressRelease"], num_contexts=6)
qa = ConversationalRetrievalChain.from_llm(model, retriever=retriever)
questions = [
"What is IBM's patent strategy?",
]
chat_history = []
for question in questions:
result = qa({"question": question, "chat_history": chat_history})
chat_history.append((question, result["answer"]))
docs = retriever.get_relevant_documents(question)
print(f"-> **Question**: {question} n")
print(f"**Answer**: {result['answer']} n")
⑨有価証券報告書からデータ抽出
5.使えそうなもの探し(実験)
-> **Question**: What is IBM's patent strategy?
**Answer**: IBM's patent strategy focuses on seeking IP protection for its innovations while also
emphasizing other initiatives designed to leverage its IP leadership. The company actively pursues
intellectual property and invests approximately 8 percent of its total revenue in research and development
(R&D). IBM Research works with clients and business units to deliver new technologies and address
challenges in areas such as artificial intelligence, quantum computing, security, cloud, and systems. In
2019, IBM was awarded more U.S. patents than any other company, with a total of 9,262 patents,
including patents related to artificial intelligence, cloud, cybersecurity, and quantum computing.
問:IBMの特許戦略は?
⇒SCE Filings(有価証券報告書みたいな情
報)から情報を収集・まとめてくれる。