å¼ãç¶ãæ±å¤§ã®ãåµé æ å ±å¦é£æºè¬ç¾©VIIãããè³æ²¢ããã®èª²é¡1ã§ããããIBMã¢ãã«1ã®å®è£ ãè¡ãã¾ãããåµé æ å ±å¦é£æºè¬åº§IBMã¢ãã«1ã®EMã¢ã«ã´ãªãºã ãå®è£ ãã¦ãµã³ãã«ãã¼ã¿ã§çµæã確èªããã¨ããåé¡ã§ãã #!/usr/bin/env python from collections import defaultdict def train(corpus): pair = defaultdict(float) for english, forein in corpus: for e in english.split(" "): for f in forein.split(" "): pair[(e,f)] += 1. print 'pair:', pair t = defaultdict(float) for e,f in pair.keys(): t[(e,f)] = 0.25 f
{{#tags}}- {{label}}
{{/tags}}