Export engine evaluations

Sort:
Nietsoj

I want to have the computer analyze a game (several games actually) and export just the engine evaluations (i.e. the scores for each move). Alternatively, I want to extract the scores from a pgn file.

Anyone have a suggestion for how to do this?

I am using Scid at the moment, but can switch to another interface if necessary.

All suggestions are welcome.

MrEdCollins

Using Scid vs. PC, you can load a pgn file and then select one or more games from within that PGN file.  You can then go fix yourself a snack while your favorite engine analyzes all of these selected games in batch mode.

Before analyzing, you, will of course select the length of time you want the engine to look at each position, the Blunder Threshhold, whether you want the engine to evaluate both sides, or just White or just Black, whether you want the engine to add variations, etc., etc., etc.

After the engine finished analyzing the last game you selected, with just a mouse click or two, you can export all of these analyzed games to a single pgn file of your choice.

The resulting pgn file will have the moves of all games, and the engine's evaluation of the position for all moves.  (If that's what you specified earlier.)  It will also list an alternate line each time your Add Scores Variations value was met, again, if this is what you wanted.

As far as extracting the scores from a PGN file, I'm not sure what you mean.  This PGN file with the scores and evaluations can then be read by other programs, of course.  If you're a programmer, you could also write a simple little utility to open and read this pgn file, and parse the data and do with it what you wish.

Nietsoj

Thanks for the reply. I am aware of the possibility to have Scid annotate/score the game, add variations and generate a pgn. So far, so good. The thing is, I want to have the scores (and nothing else) in a separate file. A bit trickier... Any suggestion?

MrEdCollins

When you say, "the scores and nothing else" do you mean you don't even want the moves? 

I don't see how that can be correct because the scores by themselves would be meaningless.  The file would just a bunch of numbers. 

So, do you want the moves, scores, but not the variations?  If this is correct, just click NO in the Add Variations section.

I suspect that's not quite correct either.

If you could give an example of your exactly what your desired output should look like, that would help more than anything else.  But I still suspect it might require a specifically written utility/program/script to parse your annotated pgn file, to give you your desired output.

Nietsoj

The bunch of numbers is exactly what I want. I see how you can think it sounds strange.

The thing is I want to do some statistical analyses of the scores, for several games. So I want to minimize the manual work of editing the files. 

MrEdCollins

Ah.  Okay, that makes sense.

Well, I can pretty much guarantee there is no existing program that will do this.  You'd have to write one yourself or get someone else to write one for you.  But it's not a difficult task.  (For programmers.)  It's just a matter of opening an annotated pgn file for input, reading in and parsing the data, and then producing an output file of just the scores, in whatever format (one line per score, all on one line, etc.) suits you best. 

I could do this but right now I just have too many other programming projects on my plate.

DiogenesDue

Learn Perl ;)...

Nietsoj

Wouldn't it be possible to achieve this with a batch file?

MrEdCollins
Nietsoj wrote:

Wouldn't it be possible to achieve this with a batch file?

I don't think so.  It's too much for a batch file.  (Unless programming / writing batch files has changed from what they were like 20 years ago.)

MrEdCollins
McNastyMac wrote:

Actually, programming it with C is quite easy, just read the files and delete everything until it encounters "(", stop deleting, and when it encounters ")" start deleting again (I'm assuming the evaluations are presented as "(0.45)" like my scid does).

It's easy in any language.  Basic, C, Pascal, etc.  But it's only "easy" if you have programming experience.  Even "Hello World" would be difficult to newbies.