Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
Dim TrueLines As List = File.ReadList("C:\Users\H\Downloads\True.csv", "")
Dim FakeLines As List = File.ReadList("C:\Users\H\Downloads\Fake.csv", "")
Dim TrainLines As List
TrainLines.Initialize
Dim TestLines, TrainLines As List
TestLines.Initialize
TrainLines.Initialize
FillList(TrueLines, TrainLines, TestLines, "True")
FillList(FakeLines, TrainLines, TestLines, "Fake")
File.WriteList(File.DirApp, "Train.txt", TrainLines)
File.WriteList(File.DirApp, "Test.txt", TestLines)
Log("done")
End Sub
Private Sub FillList(Source As List, Train As List, Test As List, Category As String)
Dim IsFirst As Boolean = True
For Each line As String In Source
If IsFirst Then
IsFirst = False
Continue
End If
line = line.Trim.Replace("""", "")
If line.Length = 0 Then
Continue
End If
IIf(Rnd(1, 100) < 66, Train, Test).As(List).Add(Category & " " & line)
Next
End Sub