Spaces:
No application file
No application file
Update record_interestingness.py
Browse files
tools/record_interestingness.py
CHANGED
@@ -2,16 +2,13 @@
|
|
2 |
import csv
|
3 |
from pathlib import Path
|
4 |
|
5 |
-
def record_interestingness(
|
6 |
-
"""Label the interestingness of the
|
7 |
|
8 |
Args:
|
9 |
-
|
10 |
-
uninteresting (
|
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 |
-
|
28 |
-
|
|
|
|
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."
|