rabbit_mq correct pattern
Browse files
__pycache__/inference_svm_model.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/inference_svm_model.cpython-310.pyc and b/__pycache__/inference_svm_model.cpython-310.pyc differ
|
|
|
__pycache__/mineru_single.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/mineru_single.cpython-310.pyc and b/__pycache__/mineru_single.cpython-310.pyc differ
|
|
|
__pycache__/topic_extr.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/topic_extr.cpython-310.pyc and b/__pycache__/topic_extr.cpython-310.pyc differ
|
|
|
__pycache__/worker.cpython-310.pyc
CHANGED
|
Binary files a/__pycache__/worker.cpython-310.pyc and b/__pycache__/worker.cpython-310.pyc differ
|
|
|
output/sample_spec_output.md
CHANGED
|
@@ -1,63 +1,29 @@
|
|
| 1 |
-
# Paper 1 and Paper 2: Pure Mathematics
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-

|
| 22 |
-
|
| 23 |
-

|
| 24 |
-
|
| 25 |
-

|
| 26 |
-
|
| 27 |
-

|
| 28 |
-
|
| 29 |
-

|
| 30 |
-
|
| 31 |
-

|
| 32 |
-
|
| 33 |
-

|
| 34 |
-
|
| 35 |
-

|
| 36 |
-
|
| 37 |
-

|
| 38 |
-
|
| 39 |
-

|
| 40 |
-
|
| 41 |
# Paper 3: Statistics and Mechanics
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-

|
| 52 |
-
|
| 53 |
-

|
| 54 |
-
|
| 55 |
-

|
| 56 |
-
|
| 57 |
-

|
| 58 |
-
|
| 59 |
-

|
| 60 |
-
|
| 61 |
-

|
| 62 |
-
|
| 63 |
-

|
|
|
|
| 1 |
+
# Paper 1 and Paper 2: Pure Mathematics
|
| 2 |
+

|
| 3 |
+

|
| 4 |
+

|
| 5 |
+

|
| 6 |
+

|
| 7 |
+

|
| 8 |
+

|
| 9 |
+

|
| 10 |
+

|
| 11 |
+

|
| 12 |
+

|
| 13 |
+

|
| 14 |
+

|
| 15 |
+

|
| 16 |
+

|
| 17 |
+

|
| 18 |
+

|
| 19 |
+

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Paper 3: Statistics and Mechanics
|
| 21 |
+

|
| 22 |
+

|
| 23 |
+

|
| 24 |
+

|
| 25 |
+

|
| 26 |
+

|
| 27 |
+

|
| 28 |
+

|
| 29 |
+

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
topic_extr.py
CHANGED
|
@@ -112,13 +112,10 @@ class TopicExtractionProcessor:
|
|
| 112 |
try:
|
| 113 |
key = input_file.get("key", "")
|
| 114 |
url = input_file.get("url", "")
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
if not url or not page_field:
|
| 118 |
-
raise ValueError("Missing required 'url' or 'page' in input file")
|
| 119 |
|
| 120 |
-
|
| 121 |
-
|
| 122 |
|
| 123 |
if url.startswith(("http://", "https://")):
|
| 124 |
response = requests.get(url)
|
|
@@ -127,8 +124,12 @@ class TopicExtractionProcessor:
|
|
| 127 |
else:
|
| 128 |
with open(url, "rb") as f:
|
| 129 |
pdf_bytes = f.read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
-
subset_pdf = self.create_subset_pdf(pdf_bytes, page_indices)
|
| 132 |
|
| 133 |
dataset = PymuDocDataset(subset_pdf)
|
| 134 |
inference = doc_analyze(
|
|
|
|
| 112 |
try:
|
| 113 |
key = input_file.get("key", "")
|
| 114 |
url = input_file.get("url", "")
|
| 115 |
+
pages = input_file.get("page", [])
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
+
if not url or not pages:
|
| 118 |
+
raise ValueError("Missing required 'url' or 'page' in input file")
|
| 119 |
|
| 120 |
if url.startswith(("http://", "https://")):
|
| 121 |
response = requests.get(url)
|
|
|
|
| 124 |
else:
|
| 125 |
with open(url, "rb") as f:
|
| 126 |
pdf_bytes = f.read()
|
| 127 |
+
|
| 128 |
+
pages = self.parse_page_range(pages)
|
| 129 |
+
logger.info("Processing %s with pages %s", key, pages)
|
| 130 |
+
|
| 131 |
+
subset_pdf = self.create_subset_pdf(pdf_bytes, pages)
|
| 132 |
|
|
|
|
| 133 |
|
| 134 |
dataset = PymuDocDataset(subset_pdf)
|
| 135 |
inference = doc_analyze(
|
worker.py
CHANGED
|
@@ -129,6 +129,7 @@ class RabbitMQWorker:
|
|
| 129 |
elif pattern == "topic_extraction":
|
| 130 |
data = body_dict.get("data")
|
| 131 |
input_files = data.get("input_files")
|
|
|
|
| 132 |
logger.info("[Worker %s] Found %d file(s) for topic extraction.", thread_id, len(input_files))
|
| 133 |
|
| 134 |
for file in input_files:
|
|
|
|
| 129 |
elif pattern == "topic_extraction":
|
| 130 |
data = body_dict.get("data")
|
| 131 |
input_files = data.get("input_files")
|
| 132 |
+
# contexts = []
|
| 133 |
logger.info("[Worker %s] Found %d file(s) for topic extraction.", thread_id, len(input_files))
|
| 134 |
|
| 135 |
for file in input_files:
|