From 5d4f9408a475c1a2827bac46db3bf8ca35aed9b5 Mon Sep 17 00:00:00 2001 From: Eric Ihli Date: Thu, 22 Jul 2021 20:02:11 -0500 Subject: [PATCH] Update views --- web/README_WGU.org | 14 +- web/resources/public/README_WGU.htm | 428 ++++++++++----------- web/src/com/darklimericks/server/views.clj | 8 +- 3 files changed, 224 insertions(+), 226 deletions(-) diff --git a/web/README_WGU.org b/web/README_WGU.org index 5e576be..32a471f 100644 --- a/web/README_WGU.org +++ b/web/README_WGU.org @@ -809,7 +809,7 @@ With this precaution in place, attackers will not be able to snoop the content t By having the application server behind an HAProxy load balancer, we can take advantage of the built-in HAProxy stats page for monitoring amount of traffic and health of the application servers. -[[file:assets/images/stats.png]] +[[file:images/stats.png]] http://darklimericks.com:8404/stats @@ -827,15 +827,15 @@ The first input field is for a word or phrase for which you wish to find a rhyme The first visualization is a scatter plot of rhyming words with the "quality" of the rhyme on the Y axis and the number of times that rhyming word/phrase occurrs in the training corpus on the X axis. -[[file:assets/images/wgu-vis.png]] +[[file:images/wgu-vis.png]] The second visualization is a word cloud where the size of each word is based on the frequency with which the word appears in the training corpus. -[[file:assets/images/wgu-vis-cloud.png]] +[[file:images/wgu-vis-cloud.png]] The third visualization is a table that lists all of the rhymes, their pronunciations, the rhyme quality, and the frequency. The table is sorted first by the rhyme quality then by the frequency. -[[file:assets/images/wgu-vis-table.png]] +[[file:images/wgu-vis-table.png]] * D. Documentation :PROPERTIES: @@ -925,11 +925,11 @@ and more. ** Visualizations -[[file:assets/images/rhyme-scatterplot.png]] +[[file:images/rhyme-scatterplot.png]] -[[file:assets/images/wordcloud.png]] +[[file:images/wordcloud.png]] -[[file:assets/images/rhyme-table.png]] +[[file:images/rhyme-table.png]] ** Accuracy diff --git a/web/resources/public/README_WGU.htm b/web/resources/public/README_WGU.htm index 322e519..fa8d45f 100644 --- a/web/resources/public/README_WGU.htm +++ b/web/resources/public/README_WGU.htm @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + RhymeStorm™ - WGU CSCI Capstone Project @@ -223,111 +223,111 @@

Table of Contents

-
-

1 WGU Evaluator Notes

+
+

1 WGU Evaluator Notes

Hello! I hope you enjoy your time with this evaluation! @@ -361,20 +361,20 @@ After I describe the steps to initialize a development environment, you’ll

-
-

2 Evaluation Technical Documentation

+
+

2 Evaluation Technical Documentation

It’s probably not necessary for you to replicate my development environment in order to evaluate this project. You can access the deployed application at https://darklimericks.com/wgu and the libraries and supporting code that I wrote for this project at https://github.com/eihli/clj-tightly-packed-trie, https://github.com/eihli/syllabify, and https://github.com/eihli/prhyme. The web server and web application is not hosted publicly but you will find it uploaded with my submission as a .tar archive.

-
-

2.1 How To Initialize Development Environment

+
+

2.1 How To Initialize Development Environment

-
-

2.1.1 Required Software

+
+

2.1.1 Required Software

  • Docker
  • @@ -384,8 +384,8 @@ It’s probably not necessary for you to replicate my development environmen
-
-

2.1.2 Steps

+
+

2.1.2 Steps

  1. Run ./db/run.sh && ./kv/run.sh to start the docker containers for the database and key-value store. @@ -399,12 +399,12 @@ It’s probably not necessary for you to replicate my development environmen
-
-

2.2 How To Run Software Locally

+
+

2.2 How To Run Software Locally

-
-

2.2.1 Requirements

+
+

2.2.1 Requirements

  • Java
  • @@ -413,8 +413,8 @@ It’s probably not necessary for you to replicate my development environmen
-
-

2.2.2 Steps

+
+

2.2.2 Steps

  1. Run ./db/run.sh && ./kv/run.sh to start the docker containers for the database and key-value store. @@ -435,8 +435,8 @@ It’s probably not necessary for you to replicate my development environmen
    -
    -

    3.1 Problem Summary

    +
    +

    3.1 Problem Summary

    Songwriters, artists, and record labels can save time and discover better lyrics with the help of a machine learning tool that supports their creative endeavours. @@ -448,8 +448,8 @@ Songwriters have several old-fashioned tools at their disposal including diction

    -
    -

    3.2 Benefits

    +
    +

    3.2 Benefits

    How many sensible phrases can you think of that rhyme with “war on poverty”? What if I say that there’s a restriction to only come up with phrases that are exactly 14 syllables? That’s a common restriction when a songwriter is trying to match the meter of a previous line. What if I add another restriction that there must be primary stress at certain spots in that 14 syllable phrase? @@ -465,8 +465,8 @@ And this is a process that is perfect for machine learning. Machine learning can

    -
    -

    3.3 Product - RhymeStorm™

    +
    +

    3.3 Product - RhymeStorm™

    RhymeStorm™ is a tool to help songwriters brainstorm. It provides lyrics automatically generated based on training data from existing songs while adhering to restrictions based on rhyme scheme, meter, genre, and more. @@ -494,8 +494,8 @@ This auto-complete functionality will be similar to the auto-complete that is co

    -
    -

    3.4 Data

    +
    +

    3.4 Data

    The initial model will be trained on the lyrics from http://darklyrics.com. This is a publicly available data set with minimal meta-data. Record labels will have more valuable datasets that will include meta-data along with lyrics, such as the date the song was popular, the number of radio plays of the song, the profit of the song/artist, etc… @@ -507,8 +507,8 @@ The software can be augmented with additional algorithms to account for the type

    -
    -

    3.5 Objectives

    +
    +

    3.5 Objectives

    This software will accomplish its primary objective if it makes its way into the daily toolkit of a handful of singers/songwriters. @@ -528,8 +528,8 @@ Another example is the package that turns phrases into phones (symbols of pronun

    -
    -

    3.6 Development Methodology - Agile

    +
    +

    3.6 Development Methodology - Agile

    This project will be developed with an iterative Agile methodology. Since a large part of data science and machine learning is exploration, this project will benefit from ongoing exploration in tandem with development. @@ -545,8 +545,8 @@ The prices quoted below are for an initial minimum-viable-product that will serv

    -
    -

    3.7 Costs

    +
    +

    3.7 Costs

    Funding requirements are minimal. The initial dataset is public and freely available. On a typical consumer laptop, Hidden Markov Models can be trained on fairly large datasets in short time and the training doesn’t require the use of expensive hardware like the GPUs used to train Deep Neural Networks. @@ -630,17 +630,17 @@ These are my estimates for the time and cost of different aspects of initial dev

    -
    -

    3.8 Stakeholder Impact

    +
    +

    3.8 Stakeholder Impact

    -The only stakeholders in the project will be the record labels or songwriters. I describe the only impact to them in the 3.2 section above. +The only stakeholders in the project will be the record labels or songwriters. I describe the only impact to them in the 3.2 section above.

    -
    -

    3.9 Ethical And Legal Considerations

    +
    +

    3.9 Ethical And Legal Considerations

    Web scraping, the method used to obtain the initial dataset from http://darklyrics.com, is protected given the ruling in https://en.wikipedia.org/wiki/HiQ_Labs_v._LinkedIn. @@ -652,8 +652,8 @@ The use of publicly available data in generative works is less clear. But Micros

    -
    -

    3.10 Expertise

    +
    +

    3.10 Expertise

    I have 10 years experience as a programmer and have worked extensively on both frontend technologies like HTML/JavaScript, backend technologies like Django, and building libraries/packages/frameworks. @@ -674,8 +674,8 @@ Write an executive summary directed to IT professionals that addresses each of t

    -
    -

    4.1 Decision Support Opportunity

    +
    +

    4.1 Decision Support Opportunity

    Songwriters expend a lot of time and effort finding the perfect rhyming word or phrase. RhymeStorm™ is going to amplify user’s creative abilities by searching its machine learning model for sensible and proven-successful words and phrases that meet the rhyme scheme and meter requirements requested by the user. @@ -687,8 +687,8 @@ When a songwriter needs to find likely phrases that rhyme with “war on pov

    -
    -

    4.2 Customer Needs And Product Description

    +
    +

    4.2 Customer Needs And Product Description

    Songwriters spend money on dictionaries, compilations of slang, thesauruses, and phrase dictionaries. They spend their time daydreaming, brainstorming, contemplating, and mixing and matching the knowledge they acquire through these traditional means. @@ -708,8 +708,8 @@ Computers can process and sort this information and sort the results by quality

    -
    -

    4.3 Existing Products

    +
    +

    4.3 Existing Products

    We’re all familiar with dictionaries, thesauruses, and their shortcomings. @@ -725,8 +725,8 @@ RhymeZone is limited in its capability. It doesn’t do well finding rhymes

    -
    -

    4.4 Available Data And Future Data Lifecycle

    +
    +

    4.4 Available Data And Future Data Lifecycle

    The initial dataset will be gathered by downloading lyrics from http://darklyrics.com and future models can be generated by downloading lyrics from other websites. Alternatively, data can be provided by record labels and combined with meta-data that the record label may have, such as how many radio plays each song gets and how much profit they make from each song. @@ -750,8 +750,8 @@ Each new model can be uploaded to the web server and users can select which mode

    -
    -

    4.5 Methodology - Agile

    +
    +

    4.5 Methodology - Agile

    RhymeStorm™ development will proceed with an iterative Agile methodology. It will be composed of several independent modules that can be worked on independently, in parallel, and iteratively. @@ -775,8 +775,8 @@ Much of data science is exploratory and taking an iterative Agile approach can t

    -
    -

    4.6 Deliverables

    +
    +

    4.6 Deliverables

    • Supporting libraries source code
    • @@ -810,8 +810,8 @@ The trained data model and web interface has been deployed at the following addr
    -
    -

    4.7 Implementation Plan And Anticipations

    +
    +

    4.7 Implementation Plan And Anticipations

    I’ll start by writing and releasing the supporting libraries and packages: Tries, Syllabification/Phonetics, Rhyming. @@ -831,8 +831,8 @@ In anticipation of user growth, I’ll be deploying the final product on Dig

    -
    -

    4.8 Requirements Validation And Verification

    +
    +

    4.8 Requirements Validation And Verification

    the methods for validating and verifying that the developed data product meets the requirements and subsequently the needs of the customers @@ -852,8 +852,8 @@ The final website will integrate multiple technologies and the integrations won&

    -
    -

    4.9 Programming Environments And Costs

    +
    +

    4.9 Programming Environments And Costs

    the programming environments and any related costs, as well as the human resources that are necessary to execute each phase in the development of the data product @@ -877,8 +877,8 @@ All code was written and all models were trained on a Lenovo T15G with an Intel

    -
    -

    4.10 Timeline And Milestones

    +
    +

    4.10 Timeline And Milestones

    @@ -956,16 +956,16 @@ RhymeStorm™ is an application to help singers and songwriters brainstorm new l

    -
    -

    5.1 Descriptive And Predictive Methods

    +
    +

    5.1 Descriptive And Predictive Methods

    -
    -

    5.1.1 Descriptive Method

    +
    +

    5.1.1 Descriptive Method

      -
    1. Most Common Grammatical Structures In A Set Of Lyrics
      +
    2. Most Common Grammatical Structures In A Set Of Lyrics

      By filtering songs by metrics such as popularity, number of awards, etc… we can use this software package to determine the most common grammatical phrase structure for different filtered categories. @@ -1042,12 +1042,12 @@ In the example below, you’ll see that a simple noun-phrase is the most pop

    -
    -

    5.1.2 Prescriptive Method

    +
    +

    5.1.2 Prescriptive Method

      -
    1. Most Likely Word To Follow A Given Phrase
      +
    2. Most Likely Word To Follow A Given Phrase

      To help songwriters think of new lyrics, we provide an API to receive a list of words that commonly follow/precede a given phrase. @@ -1143,8 +1143,8 @@ In the example below, we provide a seed suffix of “bother me” and as

    -
    -

    5.2 Datasets

    +
    +

    5.2 Datasets

    The dataset currently in use was generated from the publicly available lyrics at http://darklyrics.com. @@ -1156,12 +1156,12 @@ Further datasets will need to be provided by the end-user.

    -
    -

    5.3 Decision Support Functionality

    +
    +

    5.3 Decision Support Functionality

    -
    -

    5.3.1 Choosing Words For A Lyric Based On Markov Likelihood

    +
    +

    5.3.1 Choosing Words For A Lyric Based On Markov Likelihood

    Entire phrases can be generated using the previously mentioned functionality of generating lists of likely prefix/suffix words. @@ -1177,8 +1177,8 @@ The user can supply criteria such as restrictions on the number of syllables, nu

    -
    -

    5.3.2 Choosing Words To Complete A Lyric Based On Rhyme Quality

    +
    +

    5.3.2 Choosing Words To Complete A Lyric Based On Rhyme Quality

    Another part of the decision support functionality is filtering and ordering predicted words based on their rhyme quality. @@ -1404,8 +1404,8 @@ In the example below, you’ll see that the first 20 or so rhymes are perfec

    -
    -

    5.4 Featurizing, Parsing, Cleaning, And Wrangling Data

    +
    +

    5.4 Featurizing, Parsing, Cleaning, And Wrangling Data

    The data processing code is in https://github.com/eihli/prhyme @@ -1441,8 +1441,8 @@ words can be compared: “Foo” is the same as “foo”.

    -
    -

    5.5 Data Exploration And Preparation

    +
    +

    5.5 Data Exploration And Preparation

    The primary data structure and algorithms supporting exploration of the data are a Markov Trie @@ -1490,8 +1490,8 @@ All Trie code is hosted in the git repo located at -

    5.6 Data Visualization Functionalities For Data Exploration And Inspection

    +
    +

    5.6 Data Visualization Functionalities For Data Exploration And Inspection

    The functionality to explore and visualize data is baked into the Trie data structure. @@ -1501,7 +1501,7 @@ The functionality to explore and visualize data is baked into the Trie data stru By simply viewing the Trie in a Clojure REPL, you can inspect the Trie’s structure.

    -
    +
       (let [initialized-trie (->> (trie/make-trie "dog" "dog" "dot" "dot" "do" "do"))]
         initialized-trie)
         ;; => {(\d \o \g) "dog", (\d \o \t) "dot", (\d \o) "do", (\d) nil}
    @@ -1543,12 +1543,12 @@ The Hidden Markov Model data structure doesn’t lend itself to any useful g
     
    -
    -

    5.7 Implementation Of Interactive Queries

    +
    +

    5.7 Implementation Of Interactive Queries

    -
    -

    5.7.1 Generate Rhyming Lyrics

    +
    +

    5.7.1 Generate Rhyming Lyrics

    This interactive query will return a list of rhyming phrases to any word or phrase you enter. @@ -1691,8 +1691,8 @@ The interactive query for the above can be found at -

    5.7.2 Complete Lyric Containing Suffix

    +
    +

    5.7.2 Complete Lyric Containing Suffix

    -
    -

    5.9 Functionalities To Evaluate The Accuracy Of The Data Product

    +
    +

    5.9 Functionalities To Evaluate The Accuracy Of The Data Product

    Since creative brainstorming is the goal, “accuracy” is subjective. @@ -2022,8 +2022,8 @@ This standardized measure of accuracy can be used to compare different language

    -
    -

    5.10 Security Features

    +
    +

    5.10 Security Features

    Artists/Songwriters place a lot of value in the secrecy of their content. Therefore, all communication with the web-based interface occurs over a secure connection using HTTPS. @@ -2039,16 +2039,16 @@ With this precaution in place, attackers will not be able to snoop the content t

    -
    -

    5.11 Tools To Monitor And Maintain The Product

    +
    +

    5.11 Tools To Monitor And Maintain The Product

    By having the application server behind an HAProxy load balancer, we can take advantage of the built-in HAProxy stats page for monitoring amount of traffic and health of the application servers.

    -
    -

    stats.png +

    +

    stats.png

    @@ -2066,8 +2066,8 @@ The server also includes the certbot script for updating and mainta
    -
    -

    5.12 A User-Friendly, Functional Dashboard That Includes At Least Three Visualization Types

    +
    +

    5.12 A User-Friendly, Functional Dashboard That Includes At Least Three Visualization Types

    You can access an example of the user interface at https://darklimericks.com/wgu. @@ -2086,8 +2086,8 @@ The first visualization is a scatter plot of rhyming words with the “quali

    -
    -

    wgu-vis.png +

    +

    wgu-vis.png

    @@ -2096,8 +2096,8 @@ The second visualization is a word cloud where the size of each word is based on

    -
    -

    wgu-vis-cloud.png +

    +

    wgu-vis-cloud.png

    @@ -2106,8 +2106,8 @@ The third visualization is a table that lists all of the rhymes, their pronuncia

    -
    -

    wgu-vis-table.png +

    +

    wgu-vis-table.png

    @@ -2122,16 +2122,16 @@ Create each of the following forms of documentation for the product you have dev

    -
    -

    6.1 Business Vision

    +
    +

    6.1 Business Vision

    Provide rhyming lyric suggestions optionally constrained by syllable count.

    -
    -

    6.1.1 Requirements

    +
    +

    6.1.1 Requirements

    • [X] Given a word or phrase, suggest rhymes (ranked by quality) (Trie)
    • @@ -2147,8 +2147,8 @@ Provide rhyming lyric suggestions optionally constrained by syllable count.
    -
    -

    6.2 Data Sets

    +
    -
    -

    6.3 Data Analysis

    +
    +

    6.3 Data Analysis

    I wrote code to perform certain types of data analysis, but I didn’t find it useful to meet the business requirements of this project. @@ -2185,8 +2185,8 @@ For example, there is natural language processing code at -

    6.4 Assessment Of Hypothesis

    +
    +

    6.4 Assessment Of Hypothesis

    I’ll use an example output to subjectively assess the results of the project. @@ -2402,31 +2402,31 @@ and more.

    -
    -

    6.5 Visualizations

    +
    +

    6.5 Visualizations

    -
    -

    rhyme-scatterplot.png +

    +

    rhyme-scatterplot.png

    -
    -

    wordcloud.png +

    +

    wordcloud.png

    -
    -

    rhyme-table.png +

    +

    rhyme-table.png

    -
    -

    6.6 Accuracy

    +
    +

    6.6 Accuracy

    It’s difficult to objectively test the models accuracy since the goal of “brainstorm new lyric” is such a subjective goal. A valid test of that goal will require many human subjects to subjectively evaluate their performance while using the tool compared to their performance without the tool. @@ -2437,8 +2437,8 @@ If we allow ourselves the assumption that the close a generated phrase is to a v

    -
    -

    6.6.1 Percentage Of Generated Lines That Are Valid English Sentences

    +
    -
    -

    6.7 Testing

    +
    +

    6.7 Testing

    My language of choice for this project encourages a programming technique or paradigm known as REPL-driven development. REPL stands for Read-Eval-Print-Loop. This is a way to write and test code in real-time without a compilation step. Individual code chunks can be evaluated inside an editor, resulting in rapid feedback. @@ -2561,12 +2561,12 @@ Here is an example of the test suite for the code related to syllabification:

    -
    -

    6.8 Source Code

    +
    +

    6.8 Source Code

    -
    -

    6.8.1 Tightly Packed Trie

    +
    +

    6.8.1 Tightly Packed Trie

    This is the data structure that backs the Hidden Markov Model. @@ -2578,8 +2578,8 @@ This is the data structure that backs the Hidden Markov Model.

    -
    -

    6.8.2 Phonetics

    +
    +

    6.8.2 Phonetics

    This is the helper library that syllabifies and manipulates words, phones, and syllables. @@ -2591,8 +2591,8 @@ This is the helper library that syllabifies and manipulates words, phones, and s

    -
    -

    6.8.3 Rhyming

    +
    +

    6.8.3 Rhyming

    This library contains code for analyzing rhymes, sentence structure, and manipulating corpuses. @@ -2604,8 +2604,8 @@ This library contains code for analyzing rhymes, sentence structure, and manipul

    -
    -

    6.8.4 Web Server And User Interface

    +
    +

    6.8.4 Web Server And User Interface

    This application is not publicly available. I’ll upload it with submission of the project. @@ -2614,16 +2614,16 @@ This application is not publicly available. I’ll upload it with submission

    -
    -

    6.9 Quick Start

    +
    +

    6.9 Quick Start

    -
    -

    6.9.1 How To Initialize Development Environment

    +
    +

    6.9.1 How To Initialize Development Environment

      -
    1. Required Software
      +
    2. Required Software
      • Docker
      • @@ -2633,7 +2633,7 @@ This application is not publicly available. I’ll upload it with submission
    3. -
    4. Steps
      +
    5. Steps
      1. Run ./db/run.sh && ./kv/run.sh to start the docker containers for the database and key-value store. @@ -2648,12 +2648,12 @@ This application is not publicly available. I’ll upload it with submission
      -
      -

      6.9.2 How To Run Software Locally

      +
      +

      6.9.2 How To Run Software Locally

        -
      1. Requirements
        +
      2. Requirements
        • Java
        • @@ -2662,7 +2662,7 @@ This application is not publicly available. I’ll upload it with submission
      3. -
      4. Steps
        +
      5. Steps
        1. Run ./db/run.sh && ./kv/run.sh to start the docker containers for the database and key-value store. @@ -2682,7 +2682,7 @@ This application is not publicly available. I’ll upload it with submission

        Author: Eric Ihli

        -

        Created: 2021-07-22 Thu 19:41

        +

        Created: 2021-07-22 Thu 19:51

        diff --git a/web/src/com/darklimericks/server/views.clj b/web/src/com/darklimericks/server/views.clj index fe5acc1..bbc4143 100644 --- a/web/src/com/darklimericks/server/views.clj +++ b/web/src/com/darklimericks/server/views.clj @@ -366,9 +366,7 @@ prefixes to that rhyming phrase."] [:div#myChart] [:br] [:br] - [:br] - [:iframe {:src "/assets/README_WGU.htm" - :style "background-color: white; width: 100%; height: 760px;"}]]) + [:br]]) (defn lyric-suggestions [request suggestions] @@ -482,8 +480,8 @@ more common the word."] :font "Helvetica Neue, Arial", :fontSize {:field :score}, :fontWeight "normal", - :fontSizeRange [8 36], - :padding 1, + :fontSizeRange [{:signal :fontSizeRange0} {:signal :fontSizeRange1}], + :padding {:signal :wordPadding}, :rotate {:field :rotate}}]}] :scales [{:name :color,