Git Product home page Git Product logo

parclassifier's Introduction

ParClassifier

Simple implementation of experiments for evaluating Paraphrase Detectors/Semantic Similarity Estimators based on linear classifires applied to vector sentence representations, as published in Souza and Sanches, 2018 (an earlier version in english language can be obtained at: http://www.inf.pucrs.br/linatural/wordpress/wp-content/uploads/2018/09/123450040.pdf)).

Usage

This code is written for python 3.7. To download, clone this repository:

git clone https://github.com/marlovss/ParClassifier.git

The experiment was divide into two main parts: computing sentence representations (computeRep.py) and evaluate these representations for paraphrase classification and semantic similarity prediction (evaluate.py)

Computing Sentence Representations

The computation of sentence representation is performed by the script computeRep.py. This script optionally takes as input a configuration file (Example: rep.cfg) which defines experiment parameters.

Usage:

the configuration file defines paths to the input, as well as the pre-trained models for different word representations (word embeddings, skip-thought model, Elmo model etc) and path for outputs, as well as which representations should be computed in the experiment.

Obtaining the input data

The input data should be compatible with ASSIN corpus, e.g. [http://nilc.icmc.usp.br/assin/] and [https://sites.google.com/view/assin2/].

Word Representations and language models

To compute the representations, the script uses:

Evaluating Sentence Representations

The evaluation of sentence representations for paraphrase classificatio nand semantic similarity estimation is performed by the script evaluate.py and evaluation metric are printed on the terminal.

Usage:

The parameters define:

  • input (default: "data/vectors") : Path to the directory containing the text files
  • train (default: "train"): Path to the directory containing the train data files
  • test (default: "test"):Path to the directory containing the test data files
  • oversample (default: "none"): oversampling method to be used (possible "none","random", "smote" and "adasyn")
  • total (default: False): Whether the classifier should test a dataset with combined representations (memory expensive and low performance).
  • sim (default: False):If True evaluates Sentence Similarity Estimation, otherwise evaluates Paraphrase Classification

Dependencies

All the dependencies are listed in the requirements.txt file. They can be installed with pip as follows:

pip3 install -r requirements.txt

parclassifier's People

Contributors

marlovss 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.