summaryrefslogtreecommitdiff
path: root/training/crf/baum_welch_example/random_init.pl
blob: 98467ed1a656bd8b37bde621718408f6805d9a19 (plain)
1
2
3
4
5
6
7
8
9
#!/usr/bin/perl -w
while(<>) {
  chomp;
  my ($a,$b,@d) =split /\s+/;
  die "Bad input" if scalar @d > 0;
  $r = -rand() * rand() - 0.5;
  $r = 0 if $a =~ /^Uni:/;
  print "$a $r\n";
}