File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change 3
3
from .json import load_gql_dump
4
4
from pathlib import Path
5
5
import re
6
- from tqdm import tqdm
7
- from joblib import Parallel , delayed
8
6
9
7
class Paper :
10
8
def __init__ (self , text , tables , annotations ):
@@ -53,14 +51,13 @@ def __iter__(self):
53
51
54
52
def _load_texts (self ):
55
53
files = list ((self .path / "texts" ).glob ("**/*.json" ))
56
- texts = Parallel ( n_jobs = - 1 , prefer = "processes" )( delayed ( PaperText .from_file ) (f ) for f in files )
54
+ texts = [ PaperText .from_file (f ) for f in files ]
57
55
return {clear_arxiv_version (text .meta .id ): text for text in texts }
58
56
59
57
60
58
def _load_tables (self , annotations ):
61
59
files = list ((self .path / "tables" ).glob ("**/metadata.json" ))
62
- tables = Parallel (n_jobs = - 1 , prefer = "processes" )(delayed (read_tables )(f .parent , annotations ) for f in files )
63
- return {clear_arxiv_version (f .parent .name ): tbls for f , tbls in zip (files , tables )}
60
+ return {clear_arxiv_version (f .parent .name ): read_tables (f .parent , annotations ) for f in files }
64
61
65
62
def _load_annotated_papers (self ):
66
63
dump = load_gql_dump (self .path / "structure-annotations.json.gz" , compressed = True )["allPapers" ]
You can’t perform that action at this time.
0 commit comments