Bugfix
This commit is contained in:
@@ -437,19 +437,6 @@ def _process_verification_row(row_num, row_data):
|
|||||||
return entry_text
|
return entry_text
|
||||||
|
|
||||||
def process_verification_only():
|
def process_verification_only():
|
||||||
"""
|
|
||||||
Modus 51: Verifizierung (Wikipedia + Brancheneinordnung) im Batch-Modus.
|
|
||||||
Verarbeitet jeweils Config.BATCH_SIZE Einträge, bei denen noch keine Wiki-Verifizierung (Spalte S) vorliegt.
|
|
||||||
Ergebnisse:
|
|
||||||
- Spalte S: Wiki Confirm (OK, falls Artikel passt)
|
|
||||||
- Spalte U: Alternative Wiki URL (falls Artikel unpassend oder keiner gefunden wurde)
|
|
||||||
- Spalte V: Wiki Erklärung (Begründung)
|
|
||||||
- Spalte W: Branchenvorschlag (ChatGPT, basierend auf Spalten G, H, O, R)
|
|
||||||
- Spalte Y: Branchenkonsistenz (OK oder X inkl. Begründung)
|
|
||||||
- Spalte AQ: Token Count des Batch-Prompts (gleich für alle Einträge)
|
|
||||||
- Spalte AO: Verifizierungs-Timestamp
|
|
||||||
- Spalte AP: Versionsnummer
|
|
||||||
"""
|
|
||||||
debug_print("Starte Verifizierungsmodus (Modus 51) im Batch-Prozess...")
|
debug_print("Starte Verifizierungsmodus (Modus 51) im Batch-Prozess...")
|
||||||
gc = gspread.authorize(ServiceAccountCredentials.from_json_keyfile_name(
|
gc = gspread.authorize(ServiceAccountCredentials.from_json_keyfile_name(
|
||||||
Config.CREDENTIALS_FILE, ["https://www.googleapis.com/auth/spreadsheets"]))
|
Config.CREDENTIALS_FILE, ["https://www.googleapis.com/auth/spreadsheets"]))
|
||||||
@@ -459,9 +446,9 @@ def process_verification_only():
|
|||||||
batch_size = Config.BATCH_SIZE
|
batch_size = Config.BATCH_SIZE
|
||||||
batch_entries = []
|
batch_entries = []
|
||||||
row_indices = []
|
row_indices = []
|
||||||
# Prüfe Spalte S (Index 18) – falls leer, verarbeite Eintrag
|
# Prüfe Spalte AO (Index 40) für den Verifizierungstimestamp: nur leere Zeilen verarbeiten
|
||||||
for i, row in enumerate(data[1:], start=2):
|
for i, row in enumerate(data[1:], start=2):
|
||||||
if len(row) <= 19 or row[18].strip() == "":
|
if len(row) <= 41 or row[40].strip() == "":
|
||||||
entry_text = _process_verification_row(i, row)
|
entry_text = _process_verification_row(i, row)
|
||||||
batch_entries.append(entry_text)
|
batch_entries.append(entry_text)
|
||||||
row_indices.append(i)
|
row_indices.append(i)
|
||||||
@@ -687,6 +674,9 @@ if __name__ == "__main__":
|
|||||||
for row_num in row_indices:
|
for row_num in row_indices:
|
||||||
main_sheet.update(values=[[str(token_count)]], range_name=f"AQ{row_num}")
|
main_sheet.update(values=[[str(token_count)]], range_name=f"AQ{row_num}")
|
||||||
debug_print(f"Batch-Token-Zählung abgeschlossen. Token: {token_count}")
|
debug_print(f"Batch-Token-Zählung abgeschlossen. Token: {token_count}")
|
||||||
elif MODE == "51":
|
elif MODE == "51":
|
||||||
process_verification_only()
|
gh = GoogleSheetHandler()
|
||||||
|
start_index = gh.get_start_index(column_index=40) # Spalte AO prüfen
|
||||||
|
debug_print(f"Verifizierungsmodus: Starte bei Zeile {start_index+1}")
|
||||||
|
process_verification_only()
|
||||||
print(f"\n✅ Auswertung abgeschlossen ({Config.VERSION})")
|
print(f"\n✅ Auswertung abgeschlossen ({Config.VERSION})")
|
||||||
|
|||||||
Reference in New Issue
Block a user