Regulatory Monitoring: FR
Keeping up with the Federal Register
For many of the world's largest companies and law firms, the Federal Register is a critical source of information. It is the official journal of the federal government of the United States and contains a wide variety of documents, including proposed rules, final rules, notices, and presidential documents.
Nearly every day, the Federal Register publishes dozens to hundreds of these documents. Each one can often be hundreds of pages long, difficult to read and understand, and contain a wide variety of topics both relevant and irrelevant to an organization. Under these circumstances, it can be practically impossible to keep up through manual review.
Luckily, the Kelvin Legal Data OS can help. Not only does Kelvin Research support the Federal Register's APIs, but Kelvin NLP also provides a variety of tools to help summarize, search, and understand the Federal Register.
Retrieving the Daily Feed of the Publications
We'll walk through a simple example of how Kelvin can be used to simplify the process of regulatory monitoring for a large financial institution that interacts with consumer financial products. In this example, we'll first use Kelvin to monitor the Federal Register for proposed rules and final rules that may be relevant to consumer financial products broadly. Then, we'll ask Kelvin to help communicate our findings to our colleagues or stakeholders inside the organization.
Kelvin is most frequently used through Jupyter notebooks in the Kelvin Data Lab, which makes it easy to collaborate and iterate. Like all Python code, Jupyter notebooks start with the imports necessary to run the code. The following code imports the Kelvin libraries that we'll need to start this example:
# import Kelvin Research module for the Federal Register
from kelvin.research.fr.feed.updater import FRUpdater
# import Kelvin NLP module for summarization and question answering
from kelvin.nlp.llm.engines.openai_engine import OpenAIEngine
from kelvin.nlp.llm.qa.recursive_split_answerer import RecursiveSplitAnswerer
Next, we'll create a new OpenAI GPT-4 engine and a Kelvin NLP answering engine that
uses this engine. Note that Kelvin supports many other LLM engines, including local engines using Hugging Face
transformers
.
# create a GPT-4 engine
llm_gpt4 = OpenAIEngine(model="gpt-4")
# create a Kelvin NLP answering engine
answerer = RecursiveSplitAnswerer(engine=llm_gpt4)
Now, we'll create a Federal Register updater class, which handles the process of querying the Federal Register's APIs to list, retrieve, and store documents.
# create a Federal Register updater
fr_source = FRUpdater()
# we'll also constrain the date range for this example
import datetime
start_date = datetime.date(2023, 5, 1)
end_date = datetime.date(2023, 5, 2)
Identifying Relevant Documents for your Organization
We're now ready to review all Federal Register documents published on May 1, 2023. We will ask Kelvin to use GPT-4 to check whether each document is relevant to consumer financial products. If so, we'll list the citation, title, and the reasoning behind why Kelvin thinks the document is relevant.
# set the filtering question
question = """Does the document abstract or title relate to consumer financial
products? Begin your response with yes or no."""
# iterate through all documents
async for doc in fr_source.get_all_documents(start_date, end_date):
# to make this example run faster, we'll only look at the title and abstract, but you can
# also send the full text of the document.
title_abstract_text = "Title: " + doc['title'] + "\n\n" + \
"Abstract: " + doc['abstract']
# ask Kelvin to answer the question
answer = answerer.get_answer(title_abstract_text, question)
if answer.lower().startswith("yes"):
print(doc["citation"], "\t", doc['title'], "\t", answer)
The output of this code is the list below:
Citation | Title | Answer |
---|---|---|
88 FR 26475 | Fair Debt Collection Practices Act (Regulation F); Time-Barred Debt | Yes, the document abstract relates to consumer financial products because it discusses the Fair Debt Collection Practices Act (FDCPA) and its implementing Regulation F, which involve the collection of debts, including time-barred mortgage debts, by debt collectors. these debts can be considered as consumer financial products. |
88 FR 26527 | Combined Community Bank Advisory Council and Credit Union Advisory Council Meeting | Yes, the document abstract and title relate to consumer financial products as they mention the Community Bank Advisory Council (CBAC) and the Credit Union Advisory Council (CUAC) of the Consumer Financial Protection Bureau (CPFB or Bureau). |
88 FR 26528 | Consumer Advisory Board Meeting | Yes, the document abstract relates to consumer financial products because it pertains to a public meeting of the Consumer Advisory Board (CAB) of the Consumer Financial Protection Bureau (CFPB or Bureau), which is an organization responsible for consumer financial products and services protection. |
88 FR 26528 | Academic Research Council Meeting | Yes, the document relates to consumer financial products as it mentions the Academic Research Council (ARC or Council) of the Consumer Financial Protection Bureau (CFPB or Bureau), which is an organization that deals with consumer financial products and services. |
We can see that Kelvin has identified four documents that are relevant to our organization's regulatory monitoring. We can also see that Kelvin has provided a short explanation of why it thinks each document is relevant. This explanation can be useful for understanding why Kelvin thinks a document is relevant and for communicating this information to others. But what if we want help preparing a more traditional communication or digest for our colleagues?
Drafting Summary Communications
Kelvin can also help with drafting real work product. We'll use Kelvin to summarize the table above in the form of a standard email memo. More than that, we'll ask Kelvin to write the memo in the style of a chill pirate lawyer to demonstrate how easy it is to customize Kelvin's writing style.
First, let's imagine that we'd stored our results from above in a list or dataframe. We'll now reformat them like this:
The following is a list of Federal Register documents related to
consumer financial products:
Citation: 88 FR 26475
Title: Fair Debt Collection Practices Act (Regulation F); Time-Barred Debt
Explanation: Yes, the document abstract relates to consumer financial ...
Citation: ...
Next, we'll create a Kelvin TextMemoizer, which is a class that uses an LLM engine to write text in a particular style. We'll use the same GPT-4 engine as before, but we'll specify that we want Kelvin to write in the style of a "super chill pirate lawyer" writing an "email memo for a bank risk committee". Then, we'll ask this memoizer to write a memo summarizing the list of documents we've created above.
# create a memo-writing "Memoizer" - but make it fun
memoizer = TextMemoizer(
engine=llm_gpt4,
context_role="super chill pirate lawyer",
context_type="email memo for a bank risk committee"
)
# draft the summary memo from the text above
summary_memo = memoizer.get_summary(search_result_text)
The output of this code is the following memo:
Ahoy, Bank Risk Committee,
I be hopin' this message finds ye in fair winds and following seas. As ye
requested, I have gone through the latest Federal Register documents related
to consumer financial products and provide ye with a summary below.
1. Citation: 88 FR 26475
Title: Fair Debt Collection Practices Act (Regulation F); Time-Barred Debt
Aye, this document be related to consumer financial products as it discusses
the FDCPA and its implementation regarding the collection of debts,
including time-barred mortgage debts, by debt collectors.
2. Citation: 88 FR 26527
Title: Combined Community Bank Advisory Council and Credit Union Advisory
Council Meeting
Indeed, the document relates to consumer financial products, mentioning the
CBAC and CUAC of the Consumer Financial Protection Bureau (CPFB) or Bureau,
arr.
3. Citation: 88 FR 26528
Title: Consumer Advisory Board Meeting
Aye, this document be related to consumer financial products, dealing with
a public meeting of the Consumer Advisory Board (CAB) of the CFPB, an
organization responsible for consumer financial products and services protection.
4. Citation: 88 FR 26528
Title: Academic Research Council Meeting
Surely, the document be related to consumer financial products, as it mentions
the Academic Research Council (ARC) of the CFPB, which deals with consumer
financial products and services, arr.
I trust this information be useful to ye and the whole risk committee as ye
navigate these treacherous waters. Should ye need further guidance or have
any queries, feel free to drop me a message by sending a bottle across the sea.
May the wind be ever in yer sails,
[Your Name]
Super Chill Pirate Lawyer
While this light-hearted memo is probably not what you'd actually send to your colleagues, it demonstrates how simple and effective it can be to use Kelvin and advanced LLMs to automate end-to-end legal work product creation from start to finish.
What’s next? Connecting regulatory changes to your internal policies and procedures
In this first regulatory monitoring example, we demonstrated how to use Kelvin Research and Kelvin NLP to automate the process of identifying and summarizing relevant regulatory documents. In the next example, we'll show you how to use the Kelvin Document Index to combine data from public 10-K SEC filings with Federal Register documents to match new regulations with the companies they might affect.