Skip to content
Snippets Groups Projects
Commit 0feacced authored by cboulanger's avatar cboulanger
Browse files

Merge remote-tracking branch 'origin/main'

# Conflicts:
#	rocket-chat-api/rocket-chat-api.ipynb
parents 86f0146b c05c2624
No related branches found
No related tags found
No related merge requests found
Showing
with 597 additions and 17 deletions
.idea
\ No newline at end of file
../.idea
!.gitignore
.*
!.env.dist
\ No newline at end of file
%% Cell type:markdown id:8e0e8a650586c779 tags:
## Create the data for a social netwwork of German Law Journal editors
Since no such data exists, the first aim is to automatically compile a list of the current editors of German-language law journals. The list of journal names is in german-law-journal-network/data/juristische-zeitschriften-lobid-berichtigt.csv . The workflow consists of an automated google search, iterate over the first three search results, and then let an AI (here: ChatGPT) extract the list of editors.
First, try with a fixed journal name
%% Cell type:code id:dc6d6d75ce9e41e1 tags:
``` python
from lib.openai import query_openai_api
from lib.google import run_google_search, download
journal_name = "Kritische Vierteljahresschrift für Gesetzgebung und Rechtswissenschaft"
instruction = f"Finde im folgenden Text die Herausgeber, Redaktion/Schriftleitung und Beirat der Zeitschrift '{journal_name}' und gebe sie im CSV-Format zurück mit den Spalten 'lastname', 'firstname', 'title', 'position', 'affiliation','role'. Die Spalte 'role' enthält entweder 'Herausgeber', 'Redaktion', 'Beirat', 'Schriftleitung' oder ist leer wenn nicht bestimmbar. Wenn keine passenden Informationen verfügbar sind, gebe nur den CSV-Header zurück. Setze alle Werte in den CSV-Spalten in Anführungszeichen."
google_query = f'{journal_name} (herausgeber | redaktion | beirat)'
google_query = f'{journal_name} intext:herausgeber|herausgegeben|redakt|schriftleit|beirat'
urls = run_google_search(google_query, lang="de", exclude=['jstor.org'], num_results=1)
website_data = download(urls[0]) # get the content of the first website found
# compare performance of different GPT models
for model in ["gpt-4", "gpt-3.5-turbo-instruct"]:
csv_data = query_openai_api(model, instruction, website_data, max_tokens=2000)
print(f"\n\n{model}\n---------------\n")
print(csv_data)
```
%% Output
gpt-4
---------------
"lastname","firstname","title","position","affiliation","role"
"Albrecht","Peter-Alexis","Prof. Dr.","Herausgeber","Goethe-Universität Frankfurt am Main","Herausgeber"
"Braum","Stefan","Prof. Dr.","Herausgeber und Redaktionsmitglied","Universität Luxemburg","Herausgeber"
"Braum","Stefan","Prof. Dr.","Herausgeber und Redaktionsmitglied","Universität Luxemburg","Redaktion"
"Broemel","Roland","Prof. Dr.","Herausgeber und Redaktionsmitglied","Goethe-Universität Frankfurt am Main","Herausgeber"
"Broemel","Roland","Prof. Dr.","Herausgeber und Redaktionsmitglied","Goethe-Universität Frankfurt am Main","Redaktion"
"Duve","Thomas","Prof. Dr.","Herausgeber","Max-Planck-Institut für europäische Rechtsgeschichte, Frankfurt am Main","Herausgeber"
"Günther","Klaus","Prof. Dr.","Herausgeber","Goethe-Universität Frankfurt am Main","Herausgeber"
"Jaeger","Marc","","Herausgeber","Präsident des Gerichts der Europäischen Union (2007-2019), Luxembourg","Herausgeber"
"Lamanda","Vincent","","Herausgeber","Président de la Cour de Cassation (2007-2014), Paris","Herausgeber"
"Pfeifer","Guido","Prof. Dr.","Herausgeber","Goethe-Universität Frankfurt am Main","Herausgeber"
"Spielmann","Dean","","Herausgeber","Richter am Gericht der Europäischen Union (EuG)","Herausgeber"
"Thomas of Cwmgiedd","John","Lord","Herausgeber","Lord Chief Justice of England and Wales (2013-2017), London","Herausgeber"
"Tröger","Tobias","Prof. Dr.","Herausgeber","Goethe-Universität Frankfurt am Main","Herausgeber"
"Vec","Miloš","Prof. Dr.","Herausgeber","Wien","Herausgeber"
"Voßkuhle","Andreas","Prof. Dr. Dres. h. c. Dr.","Herausgeber","Präsident des Bundesverfassungsgerichts a.D. (2010-2020), Karlsruhe Albert-Ludwigs-Universität Freiburg","Herausgeber"
"Wallrabenstein","Astrid","Prof. Dr.","Herausgeber","Richterin am Bundesverfassungsgericht, Karlsruhe","Herausgeber"
"Weiss","Manfred","Prof. em. Dr. Dres. h.c.","Herausgeber","Goethe-Universität Frankfurt am Main","Herausgeber"
gpt-3.5-turbo-instruct
---------------
"lastname","firstname","title","position","affiliation","role"
"","","","","",""
"","","","Der Verlag","",""
"","","","Programm","",""
"","","","Wissenschaftlich Publizieren","",""
"","","","Service","",""
"","","","Shop","",""
"","","","Allgemein","",""
"","","","Über die Zeitschrift","",""
"","","","","Herausgeberkreis","role"
"Albrecht","Peter-Alexis","Prof. Dr.","Herausgeber","Goethe-Universität Frankfurt am Main","Herausgeber"
"Braum","Stefan","Prof. Dr.","Herausgeber","Universität Luxemburg","Herausgeber"
"Broemel","Roland","Prof. Dr.","Herausgeber (geschäftsführend)","Goethe-Universität Frankfurt am Main","Herausgeber"
"Duve","Thomas","Prof. Dr.","Herausgeber","Max-Planck-Institut für europäische Rechtsgeschichte, Frankfurt am Main","Herausgeber"
"Günther","Klaus","Prof. Dr.","Herausgeber","Goethe-Universität Frankfurt am Main","Herausgeber"
"Jaeger","Marc","","Herausgeber","Präsident des Gerichts der Europäischen Union (2007-2019), Luxembourg","Herausgeber"
"Lamanda","Vincent","","Herausgeber","Président de la Cour de Cassation (2007-2014), Paris","Herausgeber"
"Pfeifer","Guido","Prof. Dr.","Herausgeber","Goethe-Universität Frankfurt am Main","Herausgeber"
"Spielmann","Dean","","Herausgeber","Richter am Gericht der Europäischen Union (EuG)","Herausgeber"
"Thomas","John","Lord QC","Herausgeber","Lord Chief Justice of England and Wales (2013-2017), London","Herausgeber"
"Tröger","Tobias","Prof. Dr.","Herausgeber","Goethe-Universität Frankfurt am Main","Herausgeber"
"Vec","Miloš","Prof. Dr.","Herausgeber","Wien","Herausgeber"
"Voßkuhle","Andreas","","Herausgeber","Präsident des Bundesverfassungsgerichts a.D. (2010-2020), Karlsruhe Albert-Ludwigs-Universität Freiburg","Herausgeber"
"Wallrabenstein","Astrid","Prof. Dr.","Herausgeber","Richterin am Bundesverfassungsgericht, Karlsruhe","Herausgeber"
"Weiss","Manfred","Prof. em. Dr. Dres. h.c.","Herausgeber","Goethe-Universität Frankfurt am Main","Herausgeber"
"Braum","Stefan","Prof. Dr.","Redaktion (V.i.S.d.P.)","Universität Luxemburg","Redaktion"
"","","","","Fakultät für Rechts-, Wirtschafts- und Finanzwissenschaften","Redaktion"
"Braum","Stefan","Prof. Dr.","Redaktionanschrift","162 A, avenue de la Faïencerie","Redaktion"
"Braum","Stefan","Prof. Dr.","Redaktionsanschrift","L-1511 Luxembourg","Redaktion"
"","","","Telefon","+352 / 46 66 44 – 6753","Redaktion"
"","","","Fax","+352 / 46 66 44 – 6811","Redaktion"
"","","","Mail","stefan.braum@uni.lu","Redaktion"
"Broemel","Roland","Prof. Dr.","Redaktion (V.i.S.d.P.)","Goethe-Universität Frankfurt","Redaktion"
"","","","House of Finance, Raum 4.41","Redaktion"
"","","","Theodor-W.-Adorno-Platz 3","Redaktion"
"","","","60323 Frankfurt am Main","Redaktion"
"","","","Telefon","069 / 798-34024","Redaktion"
"","","","Mail","broemel@jur.uni-frankfurt.de","Redaktion"
"","","","","","",""
"","","","Abstracting & Indexing","",""
"","","","","Die Zeitschrift KritV wird indexiert von","Abstracting & Indexing"
"","","","","","",""
"","","","","Urheberrecht","role"
"","","","Urheberrecht","",""
"","","","","","",""
"","","","Mediadaten","",""
"","","","Mediadaten","",""
%% Cell type:markdown id:d63225cbb467305a tags:
Clearly, GPT-3.5 is not up to the task. Now arun the combined google / gpt-4 pipeline on the whole dataset
%% Cell type:code id:a0570e05da29a5d8 tags:
``` python
import io
import os
import pandas as pd
from lib.openai import query_openai_api
from lib.google import run_google_search, download
from tqdm.notebook import tqdm
from datetime import datetime
from time import sleep
# Load or initialize journals data
if os.path.isfile("data/juristische-zeitschriften-with-editor-count.csv"):
df_journals = pd.read_csv("data/juristische-zeitschriften-with-editor-count.csv")
else:
df_journals = pd.read_csv("data/juristische-zeitschriften-lobid-berichtigt.csv")
df_journals['editor_count'] = None
# Load or initialize editors data
if os.path.isfile("data/editors.csv"):
df_editors = pd.read_csv("data/editors.csv", encoding='utf-8', index_col=False)
else:
df_editors = pd.DataFrame(columns=['journal_abbr', 'lastname', 'firstname', 'title', 'position', 'affiliation', 'role', 'website','retrieved_on'])
try:
# Iterate over each journal
for _, row in tqdm(df_journals.iterrows(), desc="Processing journals...", total=len(df_journals)):
journal_name = row['journal']
journal_abbr = row['abbreviation'].split(',')[0].strip()
# Skip if already processed
if df_editors['journal_abbr'].str.contains(journal_abbr).any() or \
(df_journals[df_journals['abbreviation'] == journal_abbr]['editor_count'].notna()).all():
num_editors = (df_editors['journal_abbr'] == journal_abbr).sum()
df_journals.loc[df_journals['abbreviation'] == journal_abbr, 'editor_count'] = num_editors
print(f"Already retrieved {num_editors} editors for '{journal_abbr}'." )
continue
# Run google query
google_query = f'{journal_name} intext:herausgeber|herausgegeben|redakt|schriftleit|beirat'
exclude=[r'jstor\.org']
urls = run_google_search(google_query, lang="de", exclude=exclude, verbose=True)
# ask GPT-4 to identify the editors in the found websites
for website_url in urls:
website_data = download(website_url, verbose=True)
if website_data is None or website_data =="":
print("Could not retrieve website content.")
sleep(3) # to avoid google blocking
continue
print(f'Sending content to GPT-4 for analysis...')
instruction = f"Finde im folgenden Text die Herausgeber, Redaktion/Schriftleitung und Beirat der Zeitschrift '{journal_name}' und gebe sie im CSV-Format zurück mit den Spalten 'lastname', 'firstname', 'title', 'position', 'affiliation','role'. Die Spalte 'role' enthält entweder 'Herausgeber', 'Redaktion', 'Beirat', 'Schriftleitung' oder ist leer wenn nicht bestimmbar. Wenn keine passenden Informationen verfügbar sind, gebe nur den CSV-Header zurück. Setze alle Werte in den CSV-Spalten in Anführungszeichen."
csv_data = query_openai_api("gpt-4", instruction, website_data, max_tokens=1800, verbose=True)
data = io.StringIO(csv_data)
try:
df = pd.read_csv(data)
except:
raise RuntimeError(f"Error while parsing response from gpt-4:\n{csv_data}")
# Save number of editors found
num_editors = len(df)
df_journals.loc[df_journals['abbreviation'] == journal_abbr, 'editor_count'] = num_editors
print(f"Found {num_editors} editors.")
# If some were found, add them to the list
if num_editors > 0:
df['website'] = website_url
df['journal_abbr'] = journal_abbr
df['retrieved_on'] = datetime.now().strftime('%Y-%m-%d')
df_editors = pd.concat([df_editors, df], ignore_index=True)
# Save updated df_editors back to file
df_editors.to_csv("data/editors.csv", encoding='utf-8', index=False)
# don't look at the other websites found to save GPT-4 tokens
break
except KeyboardInterrupt:
print("Loop interrupted by user. Saving current data.")
finally:
# Save the updated df_journals to a new file
df_journals.to_csv("data/juristische-zeitschriften-with-editor-count.csv", index=False)
```
%% Output
Already retrieved 17 editors for 'AUR'.
Already retrieved 24 editors for 'AbfallR'.
Already retrieved 12 editors for 'AL'.
Already retrieved 0 editors for 'AJP'.
Already retrieved 0 editors for 'AktStR'.
Already retrieved 4 editors for 'ASR'.
Already retrieved 13 editors for 'AnwBl'.
Already retrieved 0 editors for 'AGS'.
Already retrieved 24 editors for 'ANA-ZAR'.
Already retrieved 11 editors for 'apf'.
Already retrieved 9 editors for 'APR'.
Already retrieved 23 editors for 'AuA'.
Already retrieved 4 editors for 'AuR'.
Already retrieved 1 editors for 'ArbR'.
Already retrieved 0 editors for 'AiB'.
Already retrieved 0 editors for 'AP'.
Already retrieved 9 editors for 'AöR'.
Already retrieved 6 editors for 'AVR'.
Already retrieved 3 editors for 'AcP'.
Already retrieved 14 editors for 'AfkKR'.
Already retrieved 14 editors for 'ArchKrim'.
Already retrieved 2 editors for 'UFITA'.
Already retrieved 10 editors for 'AfP'.
Already retrieved 3 editors for 'ARSP'.
Already retrieved 10 editors for 'AfS'.
Already retrieved 2 editors for 'UFITA'.
Already retrieved 2 editors for 'UFITA'.
Already retrieved 4 editors for 'A&R'.
Already retrieved 25 editors for 'ArztR'.
Already retrieved 0 editors for 'ASDA-Bulletin'.
Already retrieved 2 editors for 'Aufsichtsrat'.
Already retrieved 1 editors for 'AuAS'.
Already retrieved 5 editors for 'AW-Prax'.
Already retrieved 3 editors for 'ARIEL'.
Already retrieved 0 editors for 'AWR-Bulletin'.
Already retrieved 0 editors for 'BankArch'.
Already retrieved 2 editors for 'BJM'.
Already retrieved 9 editors for 'BauR'.
Already retrieved 5 editors for 'BayVBl'.
Already retrieved 16 editors for 'Br'.
Already retrieved 0 editors for 'BerlAnwBl'.
Already retrieved 2 editors for 'BtPrax'.
Already retrieved 0 editors for 'BetrAV'.
Already retrieved 9 editors for 'BB'.
Already retrieved 0 editors for 'AWD'.
Already retrieved 2 editors for 'BRuR'.
Already retrieved 2 editors for 'Betrifft Justiz'.
Already retrieved 0 editors for 'BewHi'.
Already retrieved 4 editors for 'BewertungsPraktiker'.
Already retrieved 0 editors for 'BFH/NV'.
Already retrieved 0 editors for 'BlPMZ'.
Already retrieved 0 editors for 'Blätter'.
Already retrieved 9 editors for 'BRAK-Mitt'.
Already retrieved 3 editors for 'BLJ'.
Already retrieved 1 editors for 'BBB'.
Already retrieved 0 editors for 'Bundesgesundheitsbl'.
Already retrieved 38 editors for 'CCLR'.
Already retrieved 13 editors for 'CSR'.
Already retrieved 7 editors for 'CB'.
Already retrieved 0 editors for 'CRi'.
Already retrieved 2 editors for 'CuA'.
Already retrieved 12 editors for 'CR'.
Already retrieved 5 editors for 'CuR'.
Already retrieved 20 editors for 'CCZ'.
Already retrieved 7 editors for 'CFL'.
Already retrieved 2 editors for 'COVuR'.
Already retrieved 0 editors for 'DAJV-NL'.
Already retrieved 0 editors for 'Grundeigentum'.
Already retrieved 0 editors for 'Hauseigentum'.
Already retrieved 8 editors for 'JAmt'.
Already retrieved 9 editors for 'JurBüro'.
Already retrieved 7 editors for 'StAZ'.
Already retrieved 4 editors for 'DuD'.
Already retrieved 5 editors for 'DSB'.
Already retrieved 1 editors for 'DANA'.
Already retrieved 0 editors for 'AOStB'.
Already retrieved 2 editors for 'ArbRB'.
Already retrieved 9 editors for 'AusR'.
Already retrieved 0 editors for 'AR'.
Already retrieved 0 editors for 'Bausachverständige'.
Already retrieved 19 editors for 'DB'.
Already retrieved 16 editors for 'Rpfleger'.
Already retrieved 0 editors for 'ErbStB'.
Already retrieved 0 editors for 'EStB'.
Already retrieved 2 editors for 'FamRB'.
Already retrieved 2 editors for 'gemeindehaushalt'.
Already retrieved 0 editors for 'GesRZ'.
Already retrieved 0 editors for 'GmbHStB'.
Already retrieved 0 editors for 'IPRB'.
Already retrieved 2 editors for 'ITRB'.
Already retrieved 0 editors for 'Konzern'.
Already retrieved 2 editors for 'Kriminalist'.
Already retrieved 3 editors for 'Landkreis'.
Already retrieved 3 editors for 'MedSach'.
Already retrieved 0 editors for 'MietRB'.
Already retrieved 2 editors for 'DÖD'.
Already retrieved 0 editors for 'Personalrat'.
Already retrieved 0 editors for 'DS'.
Already retrieved 0 editors for 'STAAT'.
Already retrieved 2 editors for 'StB'.
Already retrieved 0 editors for 'UStB'.
Already retrieved 2 editors for 'VerkA'.
Already retrieved 2 editors for 'Verkehrsjurist'.
Already retrieved 0 editors for 'DWE'.
Already retrieved 0 editors for 'DGVZ'.
Already retrieved 7 editors for 'DJZ'.
Already retrieved 2 editors for 'DLR'.
Already retrieved 0 editors for 'DNotZ'.
Already retrieved 0 editors for 'Deutsche Polizei'.
Already retrieved 0 editors for 'DRV'.
Already retrieved 10 editors for 'DRiZ'.
Already retrieved 0 editors for 'DStZ'.
Already retrieved 0 editors for 'DVP'.
Already retrieved 0 editors for 'DWW'.
Already retrieved 0 editors for 'DZWIR'.
Already retrieved 0 editors for 'DAR'.
Already retrieved 4 editors for 'DStR'.
Already retrieved 0 editors for 'DVBl'.
Already retrieved 31 editors for 'DPJZ'.
Already retrieved 9 editors for 'AG'.
Already retrieved 1 editors for 'Bank'.
Already retrieved 0 editors for 'BG'.
Already retrieved 2 editors for 'BKK'.
Already retrieved 0 editors for 'Gemeinde [SH]'.
Already retrieved 8 editors for 'ZMV'.
Already retrieved 37 editors for 'DÖV'.
Already retrieved 2 editors for 'PersV'.
Already retrieved 10 editors for 'Polizei'.
Already retrieved 14 editors for 'SGb'.
Already retrieved 3 editors for 'Stbg'.
Already retrieved 2 editors for 'StBp'.
Already retrieved 0 editors for 'StW'.
Already retrieved 0 editors for 'Ubg'.
Already retrieved 0 editors for 'VERW'.
Already retrieved 7 editors for 'WPg'.
Already retrieved 6 editors for 'DivRuW'.
Already retrieved 0 editors for 'DNotI-Report'.
Already retrieved 12 editors for 'ER'.
Already retrieved 0 editors for 'et'.
Already retrieved 0 editors for 'EFG'.
Already retrieved 1 editors for 'BFHE'.
Already retrieved 0 editors for 'BGHZ'.
Already retrieved 0 editors for 'BVerfGE'.
Already retrieved 1 editors for 'RGSt'.
Already retrieved 0 editors for 'EWiR'.
Already retrieved 0 editors for 'EuGRZ'.
Already retrieved 7 editors for 'EuZA'.
Already retrieved 30 editors for 'EuZW'.
Already retrieved 1 editors for 'EWS'.
Already retrieved 14 editors for 'EuR'.
Already retrieved 10 editors for 'ECFR'.
Already retrieved 22 editors for 'ECLR'.
Already retrieved 1 editors for 'EDPL'.
Already retrieved 0 editors for 'ELR'.
Already retrieved 1 editors for 'ERCL'.
Already retrieved 4 editors for 'EU-UStB'.
Already retrieved 1 editors for 'FAR'.
Already retrieved 4 editors for 'FuR'.
Already retrieved 0 editors for 'FPR'.
Already retrieved 0 editors for 'FamRK'.
Already retrieved 2 editors for 'FamFR'.
Already retrieved 0 editors for 'FA'.
Already retrieved 10 editors for 'FLF'.
Already retrieved 0 editors for 'FR'.
Already retrieved 0 editors for 'FR-Ertragssteuerrecht'.
Already retrieved 2 editors for 'FoVo'.
Already retrieved 3 editors for 'FMP'.
Already retrieved 5 editors for 'Forderungs-Praktiker'.
Already retrieved 20 editors for 'FF'.
Already retrieved 2 editors for 'Forum Kriminalpräv.'.
Already retrieved 4 editors for 'FoR'.
Already retrieved 16 editors for 'FS'.
Already retrieved 2 editors for 'Freilaw'.
Already retrieved 6 editors for 'GLJ'.
Already retrieved 0 editors for 'GYIL'.
Already retrieved 4 editors for 'GWR'.
Already retrieved 19 editors for 'GuP'.
Already retrieved 19 editors for 'GuS'.
Already retrieved 3 editors for 'GesR'.
Already retrieved 11 editors for 'GewArch'.
Already retrieved 3 editors for 'GRUR'.
Already retrieved 4 editors for 'GRUR-Int'.
Already retrieved 9 editors for 'GRUR-Prax'.
Already retrieved 3 editors for 'GRUR-RR'.
Already retrieved 8 editors for 'GmbHR'.
Already retrieved 0 editors for 'GmbH-Steuerpraxis'.
Already retrieved 0 editors for 'GA'.
Already retrieved 11 editors for 'GoJIL'.
Already retrieved 0 editors for 'GreifRecht'.
Already retrieved 2 editors for 'GuG'.
Already retrieved 14 editors for 'GRUR Int.'.
Already retrieved 2 editors for 'HRN'.
Already retrieved 15 editors for 'HJIL'.
Already retrieved 0 editors for 'HSGZ'.
Already retrieved 1 editors for 'HFR'.
Already retrieved 17 editors for 'HuV'.
Already retrieved 17 editors for 'HuV-I'.
Already retrieved 3 editors for 'HuFR'.
Already retrieved 13 editors for 'IBR'.
Already retrieved 7 editors for 'IMR'.
Searching google for Informationen zum Arbeitslosenrecht und Sozialhilferecht intext:herausgeber|herausgegeben|redakt|schriftleit|beirat...
Downloading content of https://www.nomos-shop.de/nomos/titel/info-also-informationen-zum-arbeitslosenrecht-und-sozialhilferecht-id-114028/...
Sending content to GPT-4 for analysis...
Found 22 editors.
Already retrieved 0 editors for 'InfAuslR'.
Searching google for Informationsdienst Öffentliches Dienstrecht intext:herausgeber|herausgegeben|redakt|schriftleit|beirat...
Downloading content of https://shop.wolterskluwer-online.de/rechtsgebiete/verwaltungsrecht/oeffentliches-dienstrecht/04102500-ioed-informationsdienst-oeffentliches-dienstrecht.html...
Sending content to GPT-4 for analysis...
Found 1 editors.
Searching google for InfrastrukturRecht : Energie, Verkehr, Abfall, Wasser intext:herausgeber|herausgegeben|redakt|schriftleit|beirat...
Downloading content of https://rsw.beck.de/zeitschriften/infrastrukturrecht...
Sending content to GPT-4 for analysis...
Found 17 editors.
Searching google for International insolvency law review intext:herausgeber|herausgegeben|redakt|schriftleit|beirat...
Downloading content of https://stephanmadaus.de/...
Sending content to GPT-4 for analysis...
Found 0 editors.
Downloading content of https://beck-online.beck.de/Home/53844...
Sending content to GPT-4 for analysis...
Found 0 editors.
Downloading content of https://www.amazon.de/Commencement-Insolvency-Proceedings-International-Comparative-ebook/dp/B009F7M566...
Sending content to GPT-4 for analysis...
Found 0 editors.
Searching google for International Journal of Language & Law intext:herausgeber|herausgegeben|redakt|schriftleit|beirat...
Loop interrupted by user. Saving current data.
%% Cell type:code id:4e4a9ab6ecb15270 tags:
``` python
```
......
OPENAI_API_KEY=''
HUGGINGFACEHUB_API_TOKEN=''
\ No newline at end of file
.*
!.gitignore
!.env.dist
\ No newline at end of file
This diff is collapsed.
Georg-August-Universität Göttingen Institut für Landwirtschaftsrecht
Institut
Team
Forschungsprojekte
Lehre
Veranstaltungen
Göttinger Onlinebeiträge zum Agrarrecht
LexVinum
AUR
beck-blog
Startseite AUR
Suchen English
AUR - Agrar- und Umweltrecht
Die Zeitschrift Agrar- und Umweltrecht ist die führende Zeitschrift in Deutschland für das gesamte Recht der Landwirtschaft, der Agrarmärkte und des ländlichen Raums. Die Zeitschrift wird herausgegeben von der Deutschen Gesellschaft für Agrarrecht, DGAR. Sie erscheint monatlich und bietet eine umfassende Übersicht über den Stand der Wissenschaft, Rechtsprechung und Praxis des Agrarrechts.
Das Institut für Landwirtschaftsrecht ist der Sitz der Schriftleitung
Die Redaktion der Zeitschrift "Agrar-und Umweltrecht":
Regierungsdirektor Dr. Christian Busse, Bundesministerium für Ernährung und Landwirtschaft, Bonn (Agrarproduktrecht)
Prof. Dr. Ewald Endres, Hochschule Weihenstephan-Triesdorf, Freising (Forst, Jagd, Fischerei)
Rechtsanwalt Dr. Matthias Francois, Bitburg (Bodenrecht)
Rechtsanwalt Dr. Bernd von Garmissen, Göttingen (Erb- und Gesellschaftsrecht)
Rechtsanwalt Ingo Glas, Rostock (Ziviles Agrarwirtschaftsrecht)
Rechtsanwältin Christiane Graß, Bonn (Agrarzivilrecht)
Rechtsanwalt Jens Haarstrich, Peine (Agrarzivilrecht)
Ltd. Verwaltungsdirektor Dr. Erich Koch, Sozialversicherung für Landwirtschaft, Forsten und Gartenbau, Kassel (Agrarsozialrecht)
Ministerialrat Dr. Christian Köpl, Bayerisches Staatsministerium für Ernährung, Landwirtschaft und Forsten, München (Landwirtschaftliche Betriebsmittel)
Prof. Dr. Jose Martinez, Institut für Landwirtschaftsrecht, Georg-August-Universitat Göttingen, Göttingen (Agrarförderrecht)
Ltd. Landwirtschaftsdirektor Volkmar Nies, Landwirtschaftskammer NRW, Bonn (Agrarumweltrecht)
Rechtsanwalt/Steuerberater Ralf Stephany, Bonn (Agrarsteuerrecht)
Rechtsanwalt Harald Wedemeyer, Landvolk Niedersachsen, Hannover (Öffentliches Agrarwirtschaftsrecht)
Zusendung von Manuskripten:
Die Schriftleitung freut sich über die Einsendung von Manuskripten zu agrar- und umweltrechtlichen Themen. Neben wissenschaftlichen Beiträgen mit einem Quellennachweis werden in der AuR in der Rubrik AuR-Forum auch Kurzbeiträge (ohne Quellennachweise) oder Veranstaltungshinweise abgedruckt.
Manuskripte werden in elektronischer Form im Word-Format an die email (aur@gwdg.de) erbeten. Dabei bitten wir um Beachtung der Autorenhinweise.
Alle Artikel durchlaufen vor der Publikation ein Begutachtungsverfahren (peer review). Hierzu werden die Manuskripte der Redaktion zur Begutachtung anonym vorgelegt.
AUR
Internet-Archiv der AUR
Autorenhinweise für Beiträge in der AUR
Schriftleitung Zeitschrift Agrar und Umweltrecht:
Erster Schriftleiter: Prof. Dr. José Martinez
Institut für Landwirtschaftsrecht
Platz der Göttinger Sieben 5, 37073 Göttingen,
Tel. (05 51) 39 274 15
Zweiter Schriftleiter: LLD Volkmar Nies,
Manheimer Str. 21, 50170 Kerpen,
Tel. (0 22 75) 9 19 99 10,
E-mail der Schriftleitung: aur@gwdg.de
Assistenz der Schriftleitung: Irina Valeska Schell
Kontakt
Georg-August-Universität Göttingen
Wilhelmsplatz 1 (Aula)
37073 Göttingen
Tel. 0551 39-0
Soziale Medien
Online-Dienste
Studienangebot (eCampus)
Organisation (eCampus)
Prüfungsverwaltung (FlexNow)
Lernmanagement (Stud.IP)
Studierendenportal (eCampus)
Intranet
Stellenausschreibungen
Jobportal stellenwerk
Service
Barrierefreiheit
Datenschutz
Kontakt
Notfall
Lageplan
Impressum
['Martinez, Dr. Christian Busse, Bundesministerium für Ernährung und Landwirtschaft, Bonn Agrarprodukt Recht',
'Prof. Dr. Ewald Endres, Hochschule Weihenstephan-Triesdorf Freising Forsting Forsting, Jagd, Fischerei, Fischerei',
'Lawyeranwalt Ingo Glas, Bitburg Boden Recht',
'Christiane Grass, Bonn Agrarzivil Recht',
'Jens Haarstrich, Peine Redaktionär, Rostock',
'Prof. Dr. Bernd von Garmissen, Göttingen Erb, Redaktion, Umwelt',
'Ltdr. Jose Martinez, Georg-August-Universität Göttingen, Göttingen',
'',
'',
"Note: The column 'Role' contains the following values: 'Herausgeber', 'Redaktion', 'Beirat'"]
\ No newline at end of file
"lastname","firstname","title","affiliation","role"
"Busse","Christian", "Regierungsdirektor", "Bundesministerium für Ernährung und Landwirtschaft, Bonn", "Herausgeber"
"Endres","Ewald", "Prof. Dr.", "Hochschule Weihenstephan-Triesdorf, Freising", "Redaktion"
"Francois","Matthias", "Rechtsanwalt", "Bitburg", "Redaktion"
"Garmissen","Bernd", "Rechtsanwalt", "Göttingen", "Redaktion"
"Graß","Christiane", "Rechtsanwältin", "Bonn", "Redaktion"
"Haarstrich","Jens", "Rechtsanwalt", "Peine", "Redaktion"
"Köpl","Christian", "Ministerialrat", "Bayerisches Staatsministerium für Ernährung, Landwirtschaft und Forsten, München", ""
"Martinez","Jose", "Prof. Dr.", "Institut für Landwirtschaftsrecht, Georg-August-Universität Göttingen, Göttingen", "Herausgeber"
"Nies","Volkmar", "Ltd. Landwirtschaftsdirektor", "Landwirtschaftskammer NRW, Bonn", "Redaktion"
"Stephany","Ralf", "Rechtsanwalt/Steuerberater", "Bonn", "Redaktion"
"Wedemeyer","Harald", "Rechtsanwalt", "Landvolk Niedersachsen, Hannover", "Redaktion"
"Schell","Irina Valeska", "", "Georg-August-Universität Göttingen, Göttingen", ""
\ No newline at end of file
' Here is the CSV data for the members of the editorial board or the advisory board of the journal \'AUR - Agrar- und Umweltrecht\':\n\n"lastname","firstname","title","affiliation","role"\n"Busse","Christian", "Regierungsdirektor", "Bundesministerium für Ernährung und Landwirtschaft, Bonn", "Herausgeber"\n"Endres","Ewald", "Prof. Dr.", "Hochschule Weihenstephan-Triesdorf, Freising", "Redaktion"\n"Francois","Matthias", "Rechtsanwalt", "Bitburg", "Redaktion"\n"Garmissen","Bernd", "Rechtsanwalt", "Göttingen", "Redaktion"\n"Graß","Christiane", "Rechtsanwältin", "Bonn", "Redaktion"\n"Haarstrich","Jens", "Rechtsanwalt", "Peine", "Redaktion"\n"Köpl","Christian", "Ministerialrat", "Bayerisches Staatsministerium für Ernährung, Landwirtschaft und Forsten, München", ""\n"Martinez","Jose", "Prof. Dr.", "Institut für Landwirtschaftsrecht, Georg-August-Universität Göttingen, Göttingen", "Herausgeber"\n"Nies","Volkmar", "Ltd. Landwirtschaftsdirektor", "Landwirtschaftskammer NRW, Bonn", "Redaktion"\n"Stephany","Ralf", "Rechtsanwalt/Steuerberater", "Bonn", "Redaktion"\n"Wedemeyer","Harald", "Rechtsanwalt", "Landvolk Niedersachsen, Hannover", "Redaktion"\n"Schell","Irina Valeska", "", "Georg-August-Universität Göttingen, Göttingen", ""\n\nNote: The column \'role\' is empty for some members, as their role could not be determined.'
\ No newline at end of file
,lastname,firstname,title,position,affiliation,role
0,Busse,Christian,Dr.,Regierungsdirektor,"Bundesministerium für Ernährung und Landwirtschaft, Bonn",Redaktion
1,Endres,Ewald,Prof. Dr.,,"Hochschule Weihenstephan-Triesdorf, Freising",Redaktion
2,Francois,Matthias,Dr.,Rechtsanwalt,Bitburg,Redaktion
3,von Garmissen,Bernd,Dr.,Rechtsanwalt,Göttingen,Redaktion
4,Glas,Ingo,,Rechtsanwalt,Rostock,Redaktion
5,Graß,Christiane,Rechtsanwältin,,Bonn,Redaktion
6,Haarstrich,Jens,Rechtsanwalt,,Peine,Redaktion
7,Koch,Erich,Dr.,Ltd. Verwaltungsdirektor,"Sozialversicherung für Landwirtschaft, Forsten und Gartenbau, Kassel",Redaktion
8,Köpl,Christian,Dr.,Ministerialrat,"Bayerisches Staatsministerium für Ernährung, Landwirtschaft und Forsten, München",Redaktion
9,Martinez,Jose,Prof. Dr.,,"Institut für Landwirtschaftsrecht, Georg-August-Universitat Göttingen, Göttingen",Redaktion
10,Nies,Volkmar,Ltd. Landwirtschaftsdirektor,,"Landwirtschaftskammer NRW, Bonn",Redaktion
11,Stephany,Ralf,Rechtsanwalt/Steuerberater,,Bonn,Redaktion
12,Wedemeyer,Harald,Rechtsanwalt,,"Landvolk Niedersachsen, Hannover",Redaktion
,lastname,firstname,title,position,affiliation,role
0,DGAR,,,Deutsche Gesellschaft für Agrarrecht,,Herausgeber
1,Busse,Christian,Dr.,Regierungsdirektor,"Bundesministerium für Ernährung und Landwirtschaft, Bonn",Redaktion
2,Endres,Ewald,Prof. Dr.,,"Hochschule Weihenstephan-Triesdorf, Freising",Redaktion
3,Francois,Matthias,Dr.,Rechtsanwalt,Bitburg,Redaktion
4,von Garmissen,Bernd,Dr.,Rechtsanwalt,Göttingen,Redaktion
5,Glas,Ingo,,Rechtsanwalt,Rostock,Redaktion
6,Graß,Christiane,,Rechtsanwältin,Bonn,Redaktion
7,Haarstrich,Jens,,Rechtsanwalt,Peine,Redaktion
8,Koch,Erich,Dr.,Ltd. Verwaltungsdirektor,"Sozialversicherung für Landwirtschaft, Forsten und Gartenbau, Kassel",Redaktion
9,Köpl,Christian,Dr.,Ministerialrat,"Bayerisches Staatsministerium für Ernährung, Landwirtschaft und Forsten, München",Redaktion
10,Martinez,Jose,Prof. Dr.,,"Institut für Landwirtschaftsrecht, Georg-August-Universitat Göttingen, Göttingen",Redaktion
11,Nies,Volkmar,,Ltd. Landwirtschaftsdirektor,"Landwirtschaftskammer NRW, Bonn",Redaktion
12,Stephany,Ralf,,Rechtsanwalt/Steuerberater,Bonn,Redaktion
13,Wedemeyer,Harald,,Rechtsanwalt,"Landvolk Niedersachsen, Hannover",Redaktion
14,Martinez,José,Prof. Dr.,Erster Schriftleiter,"Institut für Landwirtschaftsrecht, Göttingen",Redaktion
15,Nies,Volkmar,LLD,Zweiter Schriftleiter,50170 Kerpen,Redaktion
import requests
from dotenv import load_dotenv
from json import JSONDecodeError
import os
load_dotenv()
API_KEY = os.getenv("HUGGINGFACEHUB_API_TOKEN")
headers = {
"Accept" : "application/json",
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
def query(url, template, model_params = None, **params):
if model_params is None:
model_params = {
"temperature": 0.1,
"max_new_tokens": 2000
}
inputs = template.format_map(**params)
payload = {
"inputs": inputs,
"parameters": model_params
}
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
try:
return response.json()[0].get("generated_text")
except JSONDecodeError:
with open('tmp/response.txt', "w", encoding='utf-8') as f:
f.write(response.text)
raise RuntimeError(f'Cannot parse response from {response.url}. See tmp/response.txt')
# Experiments with https://python.langchain.com
Create a python 3.11 environment and install the following dependencies (somewhat convoluted because of dependency
problems):
`pip install typing-inspect==0.8.0 typing_extensions==4.5.0`
`pip install pydantic -U`
`pip install pydantic==1.10.11`
`pip install python-dotenv langchain langchain-cli openai huggingface_hub langchain_openai`
You need to copy `.env.dist` to `.env` and add values for the `OPENAI_API_KEY` and `HUGGINGFACEHUB_API_TOKEN`
emvironment variables.
\ No newline at end of file
*
\ No newline at end of file
ROCKETCHAT_USER_ID=''
ROCKETCHAT_API_KEY=''
\ No newline at end of file
.*
!.env.dist
\ No newline at end of file
%% Cell type:markdown id:8dbec4364449c97 tags:
%% Cell type:code id:initial_id tags:
# Test Rocket.Chat API
``` python
import requests
import os
from dotenv import load_dotenv
from json import JSONDecodeError
load_dotenv()
def call_rocket_chat_api(command, **params):
url = f'https://chat.gwdg.de/api/v1/{command}'
headers = {
'X-Auth-Token': os.getenv('ROCKETCHAT_API_KEY'),
'X-User-Id': os.getenv('ROCKETCHAT_USER_ID')
}
response = requests.get(url, headers=headers, params=params)
response.raise_for_status()
try:
return response.json()
except JSONDecodeError:
raise RuntimeError(f'Cannot parse response from {response.url}.')
teams = call_rocket_chat_api("teams.list").get('teams')
[(t.get('name'), t.get('_id'), t.get('roomId')) for t in teams]
```
%% Output
Die Room-ID sollten Sie über die API zur Auflistung aller Channel finden können (https://developer.rocket.chat/reference/api/rest-api/endpoints/rooms/channels-endpoints/get-channel-list), was aber eine riesige Liste produzieren kann, wenn dort auch die öffentlichen Channel dabei sind.
[('Note-to-self', '6123583208648d50d46136e7', 'Grib6LkDEh8BjXm5A'),
('SLT-Team', '621f3257dda518ec820fec0f', 'DLX2YQYzmwSefCFSs'),
('Arbeitsaufträge-SHK-Abt-3',
'6231a585396730692a6254af',
'h2F4wES7ALisyjFeS'),
('Machine-Learning-Team', '6243f60f3bb97e25a63651be', 'sibAdkwHQzqJChxH9'),
('mpilhlt-DH', '6246b44404cc8d8ba31517c2', 'yT4DM9pje2Cbnz7w3'),
('reference-extraction-workshops-2023',
'636a209aa7ef138927c64671',
'CXECckP3iJcT7Wzvm'),
('Literaturverwaltung', '642ab2edd4f482c368a7e364', 'ALzasJ7iwLpNzE34B'),
('Arbeitsgruppe-Gleichstellungsbericht',
'6492f49d7821ad51fcbbef97',
'6492f49e7821ad51fcbbef99'),
('mpilhlt-Auer-Doctoral-Students-plus-Coordinator',
'64b50afdf6d0cde3515015c3',
'64b50afdf6d0cde3515015c5'),
('DH-Projekte-Abt-Auer',
'655cd77374c1eb212615898e',
'655cd77374c1eb2126158990')]
Alternativ geht wahrscheinlich auch folgende API, wo Sie den Channel über den Namen finden können:
https://developer.rocket.chat/reference/api/rest-api/endpoints/rooms/channels-endpoints/get-channel-information.
%% Cell type:markdown id:894f002bf39fcb04 tags:
%% Cell type:code id:5582dd8b2d35827 tags:
%% Cell type:code id:709f6d8c845a0056 tags:
``` python
msgs = call_rocket_chat_api('channels.history', roomId='sibAdkwHQzqJChxH9').get('messages')
```
%% Cell type:markdown id:ffb79729d8b046cd tags:
%% Output
---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
Cell In[3], line 1
----> 1 msgs = call_rocket_chat_api('channels.history', roomId='sibAdkwHQzqJChxH9').get('messages')
Cell In[2], line 15, in call_rocket_chat_api(command, **params)
10 headers = {
11 'X-Auth-Token': os.getenv('ROCKETCHAT_API_KEY'),
12 'X-User-Id': os.getenv('ROCKETCHAT_USER_ID')
13 }
14 response = requests.get(url, headers=headers, params=params)
---> 15 response.raise_for_status()
16 try:
17 return response.json()
File ~\AppData\Local\miniconda3\Lib\site-packages\requests\models.py:1021, in Response.raise_for_status(self)
1016 http_error_msg = (
1017 f"{self.status_code} Server Error: {reason} for url: {self.url}"
1018 )
1020 if http_error_msg:
-> 1021 raise HTTPError(http_error_msg, response=self)
HTTPError: 400 Client Error: Bad Request for url: https://chat.gwdg.de/api/v1/channels.history?roomId=sibAdkwHQzqJChxH9
%% Cell type:code id:caee699ae846a8fc tags:
``` python
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment