| | | | | linguist.page@gmail.com

4. Input → Process → Output → Storage

Almost every NLP application follows the same pipeline. Text is received as input, processed by software, returned as output, and optionally stored for later use.

Input

with open("quran.txt", encoding="utf-8") as f:
    text = f.read()

Process

words = text.split()
word_count = len(words)

Output

print(word_count)

Output

8

Storage

with open("result.txt", "w", encoding="utf-8") as f:
    f.write(f"Word count: {word_count}")