Abstract
In a previous article, we explored how to use Ollama and DeepSeek-R1 with SingleStore for a simple example. In this article, we'll build on that example by working with a PDF document from the internet. We'll store the document and its vector embeddings in SingleStore, then use DeepSeek-R1 to identify blockchain investment opportunities.
The notebook file used in this article is available on GitHub.
Introduction
We'll follow the setup instructions from a previous article.
Fill out the notebook
We'll configure the code to use the smallest DeepSeek-R1 model, as follows:
llm = "deepseek-r1:1.5b"
ollama.pull(llm)
We'll download a PDF file that contains information about FinTech investment opportunities in Northern Ireland:
loader = OnlinePDFLoader("https://www.investni.com/sites/default/files/2021-02/NI-fintech-document.pdf")
data = loader.load()
We'll split the document, as follows:
text_splitter = RecursiveCharacterTextSplitter(
chunk_size = 2000,
chunk_overlap = 20
)
texts = text_splitter.split_documents(data)
print (f"You have {len(texts)} pages")
This gives us 23 pages.
We'll use LangChain to store the vector embeddings and document, as follows:
docsearch = SingleStoreDB.from_documents(
texts,
embeddings,
table_name = "fintech_docs",
distance_strategy = DistanceStrategy.DOT_PRODUCT,
use_vector_index = True,
vector_size = dimensions
)
Next, we'll use the following prompt:
prompt = "What are the best investment opportunities in Blockchain?"
docs = docsearch.similarity_search(prompt)
data = docs[0].page_content
print(data)
Example output:
Within our well respected financial and related professional services cluster, global leaders including Deloitte and PwC are currently working on the application of blockchain solutions within insurance, digital banking and cross-border payments.
PwC
Vox Financial Partners
The PwC global blockchain impact centre in Belfast comprises a team of fintech professionals with deep expertise and a proven record of delivery of insurance, banking, e-commerce and bitcoin products and services. The Belfast team is exploring the application of this disruptive technology to digital currencies, digital assets, identity and smart contracts. The specialist team has already delivered a significant proof of concept project for the Bank of England, to investigate the capability of distributed ledger technology.
www.pwc.co.uk
Founded in 2016, the Belfast based Fintech consultancy Vox Financial Partners works with top-tier banks and broker- dealer clients in the US and Europe. Vox offers high quality regulatory expertise to enable its clients to plan, resource and deliver major regulatory change projects. Its Opal software, is a suite of tools that provide structured contract drafting and management on a distributed ledger (permissioned blockchain). Opal reduces operational risk and legal cost by managing the single ‘golden copy' of a legal doc, and by storing documents with metadata to enable easy searching, querying and reporting.
Rakuten Blockchain Lab
www.voxfp.com
We'll then use the prompt and response as input to DeepSeek-R1, as follows:
output = ollama.generate(
model = llm,
prompt = f"Using this data: {data}. Respond to this prompt: {prompt}."
)
content = output["response"]
remove_think_tags = True
if remove_think_tags:
content = re.sub(r"<think>.*?</think>", "", content, flags = re.DOTALL)
print(content)
We'll disable <think>
and </think>
using a flag so that we can control the output of its reasoning process.
Example output:
**Best Investment Opportunities in Blockchain Technology**
1. **PwC and Deloitte: Insurance and Banking with Blockchain**
- **Focus:** Utilizes blockchain for secure transactions, cross-border payments, and insurance solutions.
- **Opportunities:** Explores innovative applications beyond traditional methods, such as digital currencies and smart contracts.
2. ** Vox Financial Partners: Identity and Smart Contracts**
- **Focus:** Delivers structured contract drafting tools (Opal) on permissioned blockchain, aiming to enhance identity verification and secure payments.
- **Opportunities:** Offers potential for innovative projects in identity management, leveraging blockchain's scalability benefits.
3. **Rakuten Blockchain Lab: Opal Software Application**
- **Focus:** Implements DLT solutions for efficient contract management, which could be expanded or acquired for further development.
- **Opportunities:** Provides scalable and secure project opportunities due to DLT's potential for high returns through economies of scale.
**Strategic Investment Considerations:**
- **Investment Strategy:** Look into joint ventures or partnerships with Deloitte, Vox Financial Partners, and Rakuten. Consider acquisitions of existing projects or expanding current initiatives.
- **Competition:** Monitor competition in the market for blockchain software and services, comparing against established players to identify potential unique opportunities.
- **Risks:** Note the rapid evolution of blockchain technology requiring continuous investment and the possibility of regulatory changes impacting identity-related applications.
- **Scalability:** Consider the potential for high returns from large-scale blockchain projects due to economies of scale but also requiring significant initial investment.
**Conclusion:**
The best investment opportunities lie in companies like Deloitte with PwC involvement and Vox Financial Partners, particularly their focus on identity and smart contracts. Rakuten's Opal software offers another key area with potential for further development.
The output contains some inaccuracies, such as incorrectly attributing blockchain work to Deloitte, misrepresenting Vox Financial Partners' focus on identity verification instead of regulatory contract management, and mistakenly associating Rakuten with Opal software. Additionally, Rakuten Blockchain Lab's role is unclear in the source data.
Summary
Overall, a more accurate summary from DeepSeek-R1 would focus on PwC's financial blockchain initiatives, Vox's regulatory technology, and the need to verify Rakuten's involvement. However, strategic investment considerations, such as assessing competition, scalability, and regulatory risks agree with key factors investors should consider in the blockchain space.
Top comments (0)