This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open Microsoft.ML | |
open Microsoft.ML | |
open Microsoft.ML.Data | |
open Microsoft.ML.Transforms.Text | |
let stopwords = [|"ourselves"; "hers"; "between"; "yourself"; "but"; "again"; "there"; "about"; "once"; "during"; "out"; "very"; "having"; "with"; "they"; "own"; "an"; "be"; "some"; "for"; "do"; "its"; "yours"; "such"; "into"; "of"; "most"; "itself"; "other"; "off"; "is"; "s"; "am"; "or"; "who"; "as"; "from"; "him"; "each"; "the"; "themselves"; "until"; "below"; "are"; "we"; "these"; "your"; "his"; "through"; "don"; "nor"; "me"; "were"; "her"; "more"; "himself"; "this"; "down"; "should"; "our"; "their"; "while"; "above"; "both"; "up"; "to"; "ours"; "had"; "she"; "all"; "no"; "when"; "at"; "any"; "before"; "them"; "same"; "and"; "been"; "have"; "in"; "will"; "on"; "does"; "yourselves"; "then"; "that"; "because"; "what"; "over"; "why"; "so"; "can"; "did"; "not"; "now"; "under"; "he"; "you"; "herself"; "has"; "just"; "where"; "too"; "only"; "myself"; "which"; "those"; "i"; "after"; "few"; "whom"; "t";"ll"; "being"; "if" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open XPlot.Plotly | |
songLyrics | |
|> Seq.map(fun row -> row.Genre) | |
|> Seq.countBy id |> Seq.toList | |
|> Chart.Pie | |
|> Chart.WithTitle "Dataset by Genre" | |
|> Chart.WithLegend true | |
songLyrics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let trainDataPath = Path.Combine("../","Data","lyrics.csv") | |
let msft = CsvFile.Load(File.Open(trainDataPath, FileMode.Open), separators = ",", quote = '"', hasHeaders= true) | |
let songLyrics = | |
msft.Rows | |
|> Seq.filter (fun row -> not(row.GetColumn "lyrics" |> String.IsNullOrEmpty)) | |
|> Seq.filter (fun row -> not(String.Equals(row.GetColumn "lyrics", "[Instrumental]", StringComparison.OrdinalIgnoreCase))) | |
|> Seq.map (fun row -> { Song = (row.GetColumn "song") | |
Artist = (row.GetColumn "artist") | |
Genre = (row.GetColumn "genre") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let trainDataPath = Path.Combine("./","Data","lyrics.csv") | |
let msft = CsvFile.Load(File.Open(trainDataPath, FileMode.Open), separators = ",", quote = '"', hasHeaders= true) | |
let songLyrics = | |
msft.Rows | |
|> Seq.filter (fun row -> not(row.GetColumn "lyrics" |> String.IsNullOrEmpty)) | |
|> Seq.map (fun row -> { Song = (row.GetColumn "song") | |
Artist = (row.GetColumn "artist") | |
Genre = (row.GetColumn "genre") | |
Lyrics = (row.GetColumn "lyrics").Replace(Environment.NewLine, ", ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open System | |
open System.Linq | |
open System.IO | |
open MathNet.Numerics | |
open MathNet.Numerics.Distributions | |
open MathNet.Numerics.LinearAlgebra | |
open MathNet.Numerics.Random | |
open FSharp.Data | |
[<CLIMutable>] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#load "Paket.fsx" | |
Paket.Package | |
["XPlot.Plotly" | |
"MathNet.Numerics" | |
"MathNet.Numerics.FSharp" | |
"FSharp.Data" | |
"Microsoft.ML"] | |
#load "XPlot.Plotly.Paket.fsx" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index | song | year | artist | genre | lyrics | |
---|---|---|---|---|---|---|
0 | ego-remix | 2009 | beyonce-knowles | Pop | Oh baby, how you doing[...] | |
1 | then-tell-me | 2009 | beyonce-knowles | Pop | playin' everything so easy[..] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type LyricsInput = | |
{ | |
Song : string | |
Artist : string | |
Genre : string | |
Lyrics : string | |
Year: int | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Debug lambda locally", | |
"type": "coreclr", | |
"request": "launch", | |
"preLaunchTask": "build", | |
"program": "/Users/samuele.resca/.dotnet/tools/.store/amazon.lambda.testtool-2.1/0.9.0/amazon.lambda.testtool-2.1/0.9.0/tools/netcoreapp2.1/any/Amazon.Lambda.TestTool.dll", | |
"args": [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet serve --help | |
dotnet-serve 1.1.0-build.88+04e32cdef73c0e47b4fc74e35b5912b505cf2622 | |
A simple command-line HTTP server | |
Usage: dotnet serve [options] | |
Options: | |
--version Show version information | |
-d|--directory <DIR> The root directory to serve. [Current directory] |