NeuralNotwork commited on
Commit
f312132
·
verified ·
1 Parent(s): 87eb730

Update record_interestingness.py

Browse files
Files changed (1) hide show
  1. tools/record_interestingness.py +7 -9
tools/record_interestingness.py CHANGED
@@ -2,16 +2,13 @@
2
  import csv
3
  from pathlib import Path
4
 
5
- def record_interestingness(titles: list[str], uninteresting: list[bool]) -> None:
6
- """Label the interestingness of the entries.
7
 
8
  Args:
9
- titles (list[str]): The titles of the entries to label.
10
- uninteresting (list[bool]): The list of booleans indicating whether the
11
- entry is uninteresting.
12
  """
13
- assert len(titles) == len(uninteresting)
14
-
15
  # Create result.csv if it doesn't exist
16
  result_file = Path("result.csv")
17
  file_exists = result_file.exists()
@@ -24,5 +21,6 @@ def record_interestingness(titles: list[str], uninteresting: list[bool]) -> None
24
  writer.writerow(["title", "uninteresting"])
25
 
26
  # Write results
27
- for title, is_uninteresting in zip(titles, uninteresting, strict=True):
28
- writer.writerow([title, int(is_uninteresting)])
 
 
2
  import csv
3
  from pathlib import Path
4
 
5
+ def record_interestingness(title: str, uninteresting: bool) -> str:
6
+ """Label the interestingness of the entry.
7
 
8
  Args:
9
+ title (str): The title of the entry to label.
10
+ uninteresting (bool): Whether the entry is uninteresting.
 
11
  """
 
 
12
  # Create result.csv if it doesn't exist
13
  result_file = Path("result.csv")
14
  file_exists = result_file.exists()
 
21
  writer.writerow(["title", "uninteresting"])
22
 
23
  # Write results
24
+ writer.writerow([title, int(uninteresting)])
25
+
26
+ return "Entry labeled successfully."