Skip to content
Snippets Groups Projects
Commit 74c84a13 authored by weirdwizardthomas's avatar weirdwizardthomas
Browse files

Added folder preprocessing

parent 61ecbf8c
No related branches found
No related tags found
No related merge requests found
import json
import os
import nltk
 
from nltk import WordNetLemmatizer
......@@ -5,6 +7,15 @@ from nltk import WordNetLemmatizer
from src.preprocessing.word_prunner import WordPrunner
 
 
def preprocess_folder(input_folder_path: str, output_persistence_path):
preprocessor = Preprocessor()
for file in os.listdir(input_folder_path):
if file.endswith(".txt"):
preprocessor.read_file(input_folder_path + file)
preprocessor.persist(output_persistence_path)
class Preprocessor:
def __init__(self):
self.words = {}
......
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