アウトプットから自分の技術力をスコア化してみませんか?PR

LAPRASでQiitaやX、connpassなど、様々なアウトプットを総合して統計的に技術力を算出!

2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

seq2seqモデルの出力を比較するコマンド

Last updated at Posted at 2019-12-17

問い

モデルの出力を比較するために次の形式のファイルを作りたい。

SOURCE  May the Force be with you.
TARGET  フォースと共に在らんことを。
BASE    フォースがあなたと共にいるように。
PROP    フォースがあなたと共にありますように。

SOURCE  ...
TARGET  ...
BASE    ...
PROP    ...
...

答え

pasteawk で終わり。

paste source.txt target.txt base.txt prop.txt \
      | awk -F'\t' '{printf "SOURCE\t%s\nTARGET\t%s\nBASE\%s\nPROP\t%s\n",$1,$2,$3,$4}'

BASEPROPの差分だけを見たいときはこっち。

paste source.txt target.txt base.txt prop.txt \
      | awk -F'\t' '$3!=$4{printf "SOURCE\t%s\nTARGET\t%s\nBASE\%s\nPROP\t%s\n",$1,$2,$3,$4}'
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?