I'm trying to reproduce a simple spam filter using naive bayes and Node.js on windows, I got a resource with these Unix commands and don't know how to run it on PowerShell:
sed -nr 's#^0 (.*)#training/\1#p' CSDMC2010_SPAM/CSDMC2010_SPAM/SPAMTrain.label | xargs node spamfilter.js -s
sed -nr 's#^1 (.*)#training/\1#p' CSDMC2010_SPAM/CSDMC2010_SPAM/SPAMTrain.label | xargs node spamfilter.js -h
SPAMTrain.label is a file contains training files' name and label (0 for spam and 1 for non-spam), after some searching, I know that sed command is used to replace text and xargs is used to bash.
So I think these commands will figure out which TRAINING files are spam and which are non-spam.
-s, -h are arguments I pass in to run the spamfilter.js
Is there any way I can run these 2 commands on PowerShell, or rewrite it to fit PowerShell command line?