Giter Site home page Giter Site logo

vocabulary_calculator's Introduction

Readme

Vocabulary Calculator

This Python script, main.py, calculates the vocabulary of a file (Currently only PDF is supported). It processes the text content of the file, tokenizes it, and lemmatizes the words to extract unique words. It then counts the frequency of each word and saves the results to a file (CSV and common text file are supported). Additionally, you can specify a limit for the number of words to extract and provide a custom path for saving the file.

Prerequisites

Before running the script, ensure you have the necessary dependencies and libraries installed. You can use the provided Makefile to simplify the setup process:

make install

This command will install the project's dependencies using Poetry, download the English language model for spaCy, and install pre-commit hooks for code quality checks.

Usage

To use the Vocabulary Calculator, execute the script main.py with the following command:

poetry run python script/main.py [OPTIONS] FILE_PATH

Options

  • --limit: The number of words to extract. This option limits the output to the most frequently occurring words.
  • --save_to: A custom path to save the output CSV file. By default, the file is saved as "vocab.csv" in the current directory.

Example

Calculate the vocabulary of a PDF file and save the results to a custom path:

python main.py --limit 100 --save_to custom_vocab.csv my_pdf.pdf

vocabulary_calculator's People

Contributors

aleksandr-sosedskyi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.