Package: poetic-py
Poetic (poetic-py on PyPi)A machine-learning package to gauge your poetic madness.BranchReleaseBuild StatusDocsCoveragedev (default)mainAboutWhy should you care?InstallationDependenciesUsageCommand-line ModeFlagsStandard application with GUIMake a sentence predictionMake a file predictionSave results to csv or textAs a Python PackageDocumentationVersions and UpdatesRoadmapCollaborationLicenseAboutPoetic (formerlyPoetry Predictor) is a Python package and application based on Natural Language Processing and deep learning models to predict how poetic the English language is. Trained on 18th- and 19th-century works, the model predicts how likely the given input is or resembles poetry.This initiative is originally part of the Robert Mayer Undergraduate Research Fellowship but now an independent, open-source project.Why should you care?Are you ever in awe that a random phrase seems sosexily poetic?Have you ever looked for a poetry prediction tool or a toolchain to work in digital humaninities?Would you like to explore the possibilities of letting machine learning models to help define poetry in the digital age?Look no further. You have found poetic.Have fun!!InstallationPython (3.5, 3.6, 3.7, 3.8) and pip (or conda) are required for Poetic to work. Now, poetic officially supports conda as well. Installation from either source will work, but stick to one or the other.To install from PyPi:pipinstallpoetic-pyTo install from conda:condainstall-ckevin931poetic-pypython-c"import nltk; nltk.download('punkt')"For installation issues and some caveats, take a lookherefor some common issues. Or, open anissueand I will be glad to help!Dependenciestensorflow >= 2nltkgensimnumpyIf you have encountered an issue with installation or dependencies, please open an issue so that I can help you out!UsagePoetic supports three modes: command-line usage, python import, and GUI. For a detailed guide on examples and other common usages, visit theTutorials and Examplessection of the documentation.Command-line ModeA single command is sufficient without need of a python script or launching the GUI.Flags-sor--Sentence:  Supply a sentence or a string of text as an input.-for--File:      Supply the path to a plain text file.-oor--Out:       Provide the path to save outputs-gor--GUI:       Launch the GUI regardless of the other flags, except for -h.-hor--help:      Help with flags.--version:             Returns the version of the package.Standard application with GUIpython-mpoeticMake a sentence predictionpython-mpoetic-s"I am poetic. Are you?"Make a file predictionpython-mpoetic-f"<PATH_TO_FILE>"Save results to csv or textpython-mpoetic-f"<PATH_TO_FILE>"-o"<PATH>.txt"python-mpoetic-f"<PATH_TO_FILE>"-o"<PATH>.csv"python-mpoetic-s"I am poetic. Are you?"-o"<PATH>.txt"As a Python PackagePoetic contains two major classes: Predictor and Diagnostics. Predictor makes predictions and returns a predictions object inherited from the Diagnostics. For detailed methods and usage, check thedocumentationand itsTutorials and Examplessection. Theutilmodule provides metadata, functionalities for loading and downloading necessary data, and initializing.Below is the most common use-case as part of the IO and prediction toolchain:importpoeticnew_pred=poetic.Predictor()sentence_result=new_pred.predict("I am poetic. Are you?")file_result=new_pred.predict_file("FILE_PATH.txt")# Process resultssentence_result.run_diagnostics()sentence_result.to_file("SAVE_PATH.txt")sentence_result.to_csv("SAVE_PATH.csv")DocumentationPoetic's officialdocumentation pageis live! For more detailed reference, please see the following for a quick guide or follow the navigation on the main page:Quickstart guideTutorials and examplesFull documentationTo visit the documentation for the versions in development or older maintenance versions ofpoetic, use the version selection at the bottom left of the page for the correct version.Versions and Updatesv1.1.0Added comparison operator support to theDiagnosticsclassAdded support for concatenating twoDiagnosticsinstances using+and+=Implemented theInfoclass as a singletonAdded support for using custom model and dictionary in thePredictorclassAdded support for loading custom dictionary and model using theInitializerclassChanged "sent model" to "lexical model" for naming accuracyAdded theoretical support for python 3.5 (No CI testing)Deprecated function parameters ("input" and "dict") to avoid overwriting builtin functions and methodsOptimized unittest infrastructure with more test coverageAdded Github README topypiRenamed all method parameter "input" to "lexical_input" in thePredictorclassRenamed "dict" to "dictionary" in thepoetic.predictor.PredictorconstructorFor all deprecations, seeherev1.0.3Added "Tutorials and Examples" section to documentationFixed file output spacing issuesFixed conda channel priority documentation for python 3.8Fixed documentation code highlightingFixed type annotation for thePredictorandPredictionsclassFixed docstrings for multiple returns with tuplesFixed conda platform conversion commands in setup.pyAdded in-line code highlighting in documentationAdded import statements to complete examplesChanged CLI help section wordingAll older changes available in ourdocumentation's changelog and versions sectionRoadmapMajor milestones:Support for poetic meter: both parsing and predictingSupport for custom models other than the default modelSupport for more default modelsTentative milestones (subject to change):Backwards compatibility with Python 3.5 (No other versions support planned)An improved GUI with better front and back endPackage-level optimizationCollaborationCollaborations are welcomed for bug fixing, general improvements, future roadmap implementations, etc. Feel free to open an issue if there is something concrete or head to discussions to present new ideas.For specific details on how to contribute, see theContribution Guidelineon our documentation page. BUt you get the point: help, fix, pull request, fork, or whatever you want.LicenseMIT licenseCopyright 2020 © Kevin Wang