Ross McNairn commited on
Commit
1a1f63d
·
1 Parent(s): 99485b6

update embedding model

Browse files
hello_wordsmith/public_wordsmith_dataset/info.txt CHANGED
@@ -1,4 +1,114 @@
1
- Wordsmith is a company based in Scotland.
2
- Gigz is CTO.
3
- Kostis and Derek are ENG.
4
- It's pretty lit.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Wordsmith is a company based in Edinburgh.
2
+ Derek is the webmaster.
3
+
4
+ Marketing Info:
5
+
6
+ Wordsmith
7
+
8
+ Industries
9
+
10
+ Join waiting list
11
+
12
+
13
+ Secure AI for enterprise legal operations
14
+ Protect your data and harness leading legal AI to make your legal team a delight to interact with across the business. Triage risks, process tasks and expand your capacity.
15
+
16
+ Join waiting list
17
+
18
+ Compliance Workflows
19
+
20
+ Privacy
21
+
22
+ Commercial
23
+
24
+ Backed by leading investors
25
+
26
+
27
+ Secure Legal AI
28
+
29
+ Delightfully simple to use
30
+ Meet your team in their workflows and provide instant results
31
+
32
+ Triage and routing
33
+
34
+ Triage critical jobs and find the right person
35
+ Analyse thousands of emails, messages and tasks to flag the ones that are critical and need your teams attention. Mission critical for teams with high volumes of routine interactions with users and their data.
36
+
37
+ Inbox triage: Set your rules and have your messages ranked by criticality to ensure you get to the right ones first.
38
+
39
+ Litigation alerts: Scan inbound emails and their attachments to notify you when inbound communications require instant access.
40
+
41
+ Compliance workflows
42
+
43
+ Complete compliance workflows in seconds
44
+ Process privacy questionnaires or RFPs, draft DPIAs and respond almost instantly to SARs and privacy queries from users.
45
+
46
+ DPIA: Accelerate the processing of DPIAs from hours to minutes
47
+
48
+ SAR: Process subject access requests
49
+
50
+ Privacy questionnaires: Process repeatable questions rapidly with exceptional quality
51
+
52
+ Commercial
53
+
54
+ Accelerate your commerical teams
55
+ Give instant feedback on commercial terms, advanced contract search and trigger contracting workflows
56
+
57
+ Advanced contract search: Sync thousands of agreements and let anyone in the business get the insight they need
58
+
59
+ Contract negotiation assistant: Give commercial teams instant feedback on commercial terms
60
+
61
+ HIGH RISK
62
+
63
+ MEDIUM RISK
64
+
65
+ LOW RISK
66
+
67
+ Unprecedented performance
68
+
69
+ Engineered for legal
70
+ Wordsmith drives exceptional performance when you are tackling legal issues. Enabling our enhanced search and query functionality gives your team unique capabilities
71
+
72
+ How do we benchmark
73
+
74
+ 84%
75
+
76
+ Wordsmith
77
+
78
+ 63%
79
+
80
+ Gemini 1.5 Pro
81
+
82
+ 48%
83
+
84
+ GPT-4 Turbo
85
+
86
+ 45%
87
+
88
+ Claude 3 Opus
89
+
90
+ *What percentage of the time these models gave correct answer on our evaluation dataset
91
+
92
+ Integrations
93
+
94
+ Wordsmith seamlessly connects with the tools central to your teams workflows
95
+
96
+
97
+
98
+ Enterprise grade security
99
+
100
+ Wordsmith is fully SOC2 certified, and our legal agents never train on your data.
101
+
102
+ Visit trust center
103
+
104
+
105
+ AI Consultancy
106
+
107
+ Making legal legendary
108
+ Speak to our team of AI consultants to help you unlock incredible productivity gains
109
+
110
+ Join the waiting list
111
+
112
+ Wordsmith
113
+
114
+ AI powered legal operations for enterprise
hello_wordsmith/wordsmith.py CHANGED
@@ -3,18 +3,29 @@ import sys
3
 
4
  import chromadb
5
  from llama_index.cli.rag import RagCLI
6
- from llama_index.core import (ChatPromptTemplate, SimpleDirectoryReader,
7
- StorageContext, VectorStoreIndex)
 
 
 
8
  from llama_index.core.base.llms.types import ChatMessage, MessageRole
9
  from llama_index.core.ingestion import IngestionPipeline
10
- from llama_index.core.prompts.base import ChatPromptTemplate
11
  from llama_index.core.query_pipeline import InputComponent, QueryPipeline
12
  from llama_index.core.response_synthesizers import TreeSummarize
13
- from llama_index.core.storage.docstore import SimpleDocumentStore
 
 
 
 
14
  from llama_index.llms.openai import OpenAI
15
  from llama_index.vector_stores.chroma import ChromaVectorStore
16
 
17
 
 
 
 
 
 
18
  def initialize_chroma_db():
19
  chroma_client = chromadb.EphemeralClient()
20
  chroma_collection = chroma_client.create_collection("wordsmith")
@@ -27,8 +38,7 @@ def setup_document_storage(vector_store):
27
  dataset_path = os.path.join(package_directory, "public_wordsmith_dataset")
28
  reader = SimpleDirectoryReader(input_dir=dataset_path)
29
  docs = reader.load_data()
30
- storage_context = StorageContext.from_defaults(vector_store=vector_store)
31
- index = VectorStoreIndex.from_documents(docs, storage_context=storage_context)
32
  return index
33
 
34
 
@@ -79,7 +89,7 @@ def configure_query_pipeline(index, llm):
79
  )
80
  query_pipeline = QueryPipeline()
81
 
82
- retriever = index.as_retriever(similarity_top_k=5)
83
  summarizer = TreeSummarize(
84
  llm=llm, streaming=True, summary_template=text_qa_chat_template
85
  )
 
3
 
4
  import chromadb
5
  from llama_index.cli.rag import RagCLI
6
+ from llama_index.core import (
7
+ ChatPromptTemplate,
8
+ SimpleDirectoryReader,
9
+ VectorStoreIndex
10
+ )
11
  from llama_index.core.base.llms.types import ChatMessage, MessageRole
12
  from llama_index.core.ingestion import IngestionPipeline
 
13
  from llama_index.core.query_pipeline import InputComponent, QueryPipeline
14
  from llama_index.core.response_synthesizers import TreeSummarize
15
+ from llama_index.core import Settings
16
+ from llama_index.embeddings.openai import (
17
+ OpenAIEmbedding,
18
+ OpenAIEmbeddingModelType
19
+ )
20
  from llama_index.llms.openai import OpenAI
21
  from llama_index.vector_stores.chroma import ChromaVectorStore
22
 
23
 
24
+ Settings.embed_model = OpenAIEmbedding(
25
+ model="text-embedding-3-small"
26
+ )
27
+
28
+
29
  def initialize_chroma_db():
30
  chroma_client = chromadb.EphemeralClient()
31
  chroma_collection = chroma_client.create_collection("wordsmith")
 
38
  dataset_path = os.path.join(package_directory, "public_wordsmith_dataset")
39
  reader = SimpleDirectoryReader(input_dir=dataset_path)
40
  docs = reader.load_data()
41
+ index = VectorStoreIndex.from_documents(docs)
 
42
  return index
43
 
44
 
 
89
  )
90
  query_pipeline = QueryPipeline()
91
 
92
+ retriever = index.as_retriever(similarity_top_k=20)
93
  summarizer = TreeSummarize(
94
  llm=llm, streaming=True, summary_template=text_qa_chat_template
95
  )