Giter Club home page Giter Club logo

mutatest's Introduction

Mutatest

Mutamorphic-test is a python3 package that provides of a two different kinds of word mutators for sentences, meaning that the original sentence will be transformed by this mutators.

How to install it

In order to install the latest version use the python3 installer pip3.

pip3 install mutamorphic-test 

How to use it

In order to use the package we need to import the mutators first with the statement:

from mutatest.mutators import ReplacementMutator,DopoutMutator

Once we have them imported we can use them. We have to create an instance of the classes in order to use them.

We can specify how many words we want them to modify, how many variants of the sentence shall be created and, in the case of the replacement, which strategy shall be used to select the words to be changed.

For the two mutators we need the following parameters (we can also use the default values):

ReplacementMutator(num_replacements: int = 1, num_variants: int = 5, selection_strategy: str = "random")
DropoutMutator(num_dropouts: int = 1, num_variants: int = 1)

Once we have our mutator we can perform mutation on a sentence in the following way:

mutated_sentence=mutator.mutate(sentence,random_seed=42)

A full example of how this package can be used would be the following:

from mutatest.mutators import ReplacementMutator

mutator=ReplacementMutator()
sentence="This is an example sentence"

mutated_sentence=mutator.mutate(sentence,random_seed=42)

print(mutated_sentence)

mutatest's People

Contributors

maarten0110 avatar tomasherq avatar dimitraka avatar

Stargazers

Luís Cruz 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.