Skip to content
Snippets Groups Projects
Commit 38da5ca5 authored by Victor Zimmermann's avatar Victor Zimmermann
Browse files
parents c36e2727 0ebacbd6
No related branches found
No related tags found
No related merge requests found
import os # for reading files import os # for reading files
from tqdm import tqdm # for counting seconds #from tqdm import tqdm # for counting seconds
import spacy # for nlp import spacy # for nlp
import networkx as nx # for visualisation import networkx as nx # for visualisation
import matplotlib.pyplot as plt # for visualisation import matplotlib.pyplot as plt # for visualisation
...@@ -46,7 +46,7 @@ class Graph: ...@@ -46,7 +46,7 @@ class Graph:
files = [corpus_path+'/'+f for f in os.listdir(corpus_path)] # list of file paths (note that no other files should be in this directory) files = [corpus_path+'/'+f for f in os.listdir(corpus_path)] # list of file paths (note that no other files should be in this directory)
spaced_word = word.replace('_', ' ') #input words are generally seperated with underscores spaced_word = word.replace('_', ' ') #input words are generally seperated with underscores
for f in tqdm(files[:]): #iterates over corpus for f in files[:]: #iterates over corpus
with open(f, 'r') as source: with open(f, 'r') as source:
try: #some decoding throws the iteration try: #some decoding throws the iteration
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment