Giter Club home page Giter Club logo

eulascript's Introduction

1 - Cloning the repository

git clone https://github.com/Tikquuss/eulascript

2 - Installing the dependencies

  • PyPDF2 and PyMuPDF: for reading pdf files
  • python-docx : for reading docx files
  • wget : for model downloading
  • pandas : to write the result in csv files
  • validators : to check the validity of the urls
  • ktrain : for loading models. It is a duplication of amaiya/ktrain modified to install tensorflow-cpu (instead of tensorflow-2.1.0-cp36-cp36m-manylinux2010_x86_64.whl) and tqdm>=4.29.1.
pip install -r eulascript/requirements.txt

3 - Try

  • model_folder : directory (or url of the directory) where the model is located (must contain the following three files: tf_model.preproc, config.json and tf_model.h5). In the case of a url the three previous files are downloaded automatically. You can use the pre-trained models directly from huggingface, but this notebook illustrates how to fine-tune these models (bert, distilbert, albert, roberta, xlnet) on our dataset with the ktrain library.
  • output_dir : folder in which the csv file(s) containing the results (in the format: clause, label, probability) will be stored (the name of the created file starts with the name, without extension, of the original file containing the license, followed optionally by a number to avoid file collisions)
  • path_to_eula : comma-separated list of documents (txt, md, pdf and docx) containing the licenses to be analyzed
  • logistic_regression : this parameter can be provided at the expense of model_folder in order to use one of the pre-trained logistic regression models (must be obligatorily made from these three models: bag_of_word, tf_idf, bert or distilbert). This parameter is ignored if it is passed at the same time as model_folder. This notebook illustrates the process of obtaining the production.pth file.
model_folder=my/model_dir_or_url
output_dir=my/output_folder
path_to_eula=my/eula.txt,my/eula.md,my/eula.pdf,my/eula.docx

python eulascript/eula.py --model_folder $model_folder --path_to_eula $path_to_eula --output_dir $output_dir
logistic_regression=bag_of_word
output_dir=my/output_folder
path_to_eula=my/eula.txt,my/eula.md,my/eula.pdf,my/eula.docx

python eulascript/eula.py --logistic_regression $logistic_regression --path_to_eula $path_to_eula --output_dir $output_dir

Note:

  • the samples folder contains some user licenses and a notebook illustrating all.
  • The associated web application is available here.

eulascript's People

Contributors

mhkane avatar tikquuss avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

mhkane

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.