How to extract ppl of this custom program?
问题 I have a program that when I run, it prints something like this in command line: file test.test: 427 sentences, 2433 words, 1186 OOVs 0 zeroprobs, logprob= -4914.55 ppl= 862.603 ppl1= 8731.65 But I only want to save the number 862.603 in an environment variable. How can I extract that single number from output of the program? 回答1: Every answer I've seen thus far has had some deficiency, so I guess I'll go ahead and add this to the mix: There are a couple of ways to do this. My preferred way