SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let trainDataPath = Path.Combine("./","Data","lyrics.csv")  
  2.     let msft = CsvFile.Load(File.Open(trainDataPath, FileMode.Open), separators = ",", quote = '"', hasHeaders= true)
  3.    
  4.     let songLyrics =
  5.            msft.Rows
  6.            |> Seq.filter (fun row -> not(row.GetColumn "lyrics" |> String.IsNullOrEmpty))
  7.            |> Seq.map (fun row -> {  Song = (row.GetColumn "song")
  8.                                      Artist = (row.GetColumn "artist")
  9.                                      Genre = (row.GetColumn "genre")
  10.                                      Lyrics = (row.GetColumn "lyrics").Replace(Environment.NewLine, ", ")
  11.                                      Year = (row.GetColumn "year") |> int
  12.                                   })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top