Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

14 missing content #16

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/parliai_public/_config/debates.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ prompt = """
You are a skim reader, specialising in capturing the key points in
frenetic parliamentary debate.
Using only the text provided, you will extract ONLY sentences verbatim
which exactly match to any of these {keywords}.
which exactly reference {keywords}. You may include sentences before and/or after
that provide useful and relevant context.
Do not paraphrase.
Do not return any answer or message if there isn't anything relevant in the text.
Do not include any political asides which do not reference any of these {keywords}.

Now extract all relevant content from the following text:

Expand Down
4 changes: 2 additions & 2 deletions src/parliai_public/_config/wrans.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ prompt = """
You are a skim reader, specialising in capturing the key points in
written parliamentary communications.
Using only the text provided, you will extract ONLY sentences verbatim
which exactly match to any of these {keywords}.
which exactly reference {keywords}. You may include sentences before and/or after
that provide useful and relevant context.
Do not paraphrase.
Do not return any answer or message if there isn't anything relevant in the text.
Do not include any political asides which do not reference any of these {keywords}.

Now extract all relevant content from the following text:

Expand Down
1 change: 1 addition & 0 deletions src/parliai_public/readers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ def make_header(self, urls: list[str] = None) -> str:
f"Publication date: {today}",
f"Period covered: {period}",
f"Search terms: {self.terms}",
f"Model used: {self.llm_name}",
"\n".join((source, *links)),
)
)
Expand Down
21 changes: 15 additions & 6 deletions src/parliai_public/readers/theyworkforyou.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,21 @@ def render(self, transcript: dict) -> str:
title = f"## {label}: [{transcript['title']}]({transcript['url']})"
processed = []
for speech in transcript["speeches"]:
if speech["name"] and "response" in speech:
speaker = (
f"### [{speech['name']}]({speech['url']})"
f" ({speech['position']})"
)
processed.append("\n\n".join((speaker, speech["response"])))
if "response" in speech:
if speech["name"]:
speaker = (
f"### [{speech['name']}]({speech['url']})"
f" ({speech['position']})"
)
processed.append(
"\n\n".join((speaker, speech["response"]))
)
else:
# if no speaker, return placeholder and response
speaker = "### No speaker assigned"
processed.append(
"\n\n".join((speaker, speech["response"]))
)

return "\n\n".join((title, *processed))

Expand Down