Coder Social home page Coder Social logo

abhisheksalian / random-word-generator Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 178 KB

This library helps you to create random words i.e noise in text data. Helpful in many tasks like the generation of random authorization token generation of constant or variable length, text data augmentation, etc.

License: MIT License

Python 100.00%
random-word-generator text-augmentation python3 random-generator text-mining natural-language-processing noise python authorization code-generation password password-generator

random-word-generator's Introduction

Random Word Generator

License: MIT PyPI Open Source? Yes! Python3 made-with-python install code quality Code Score DOI Downloads Downloads

How to install this library?

pip3 install Random-Word-Generator

OR

pip install Random-Word-Generator

Which other python packages are needed to be installed?

  • No need of any external packages
  • Only Python version >= 3 is required

What this library does?

It helps us to generate random words i.e random noise in text data which is helpful in many text augmentation based tasks, NER, etc.

Which methods are available currently in this library?

Method Args Description
.generate() None This will return a randomly generated word
.getList(num_of_words) num_of_words This will return list of random words

Setting to look out before generating random words

Basic

from RandomWordGenerator import RandomWord

# Creating a random word object
rw = RandomWord(max_word_size=10,
                constant_word_size=True,
                include_digits=False,
                special_chars=r"@_!#$%^&*()<>?/\|}{~:",
                include_special_chars=False)
Args Data Type Default Description
max_word_size int 10 Represents maximum length of randomly generated word
constant_word_size bool True Represents word length of
randomly generated word
include_digits bool False Represents whether or not to include digits in generated words
special_chars regex/string r"@_!#$%^&*()<>?/\\
|}{~:"
Represents a regex string of all specials character you want to include in generated words
include_special_chars bool False Represents inclusion of special characters in generated words

How to get started with this library?

  1. Simple random word generation with constant word size

    from RandomWordGenerator import RandomWord
    
    rw = RandomWord(max_word_size=5)
    
    print(rw.generate())
    
    Output will be some random word like
    > hdsjq
    
  2. Simple random word generation with variable word size

    from RandomWordGenerator import RandomWord
    
    rw = RandomWord(max_word_size=5,
                    constant_word_size=False)
    
    print(rw.generate())
    
    Output will be some random word like
    > gw
    
  3. Random word generation with constant word size and including special character included

    from RandomWordGenerator import RandomWord
    
    rw = RandomWord(max_word_size=5,
                    constant_word_size=True,
                    special_chars=r"@#$%.*",
                    include_special_chars=True)
    
    print(rw.generate())
    
    Output will be some random word like
    > gsd$
    
  4. If we want randomly generated words in list we just have to input the argument with number of words we want

    from RandomWordGenerator import RandomWord
    
    rw = RandomWord(max_word_size=5,
                    constant_word_size=False)
    
    print(rw.getList(num_of_random_words=3))
    
    Output will be some random word like
    > ['adjse', 'qytqw', ' klsdf', 'ywete', 'klljs']
    
    

Application

  • In cases where we need to add random noise in text
  • Text Data Augmentation based tasks
  • Can be used to generate random tokens for some particular application like authorization code
  • In Automatic Password Suggestion system

Author

I will be happy to connect with you guys!!

Linkedin

Twitter

Citation

@software{abhishek_c_salian_2020_4384164,
  author       = {Abhishek C. Salian},
  title        = {AbhishekSalian/Random-Word-Generator v1.0.0},
  month        = dec,
  year         = 2020,
  publisher    = {Zenodo},
  version      = {v1.0.0},
  doi          = {10.5281/zenodo.4384164},
  url          = {https://doi.org/10.5281/zenodo.4384164}
}

Any suggestions are most welcome.

random-word-generator's People

Contributors

abhisheksalian avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

littlefish12

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.