From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uNWtI05PNGNCdQAAbAwnHQ (envelope-from ) for ; Wed, 28 Sep 2022 15:42:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gJbAI05PNGPRagEAauVa8A (envelope-from ) for ; Wed, 28 Sep 2022 15:42:38 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3C20BA83B for ; Wed, 28 Sep 2022 15:42:38 +0200 (CEST) Received: from localhost ([::1]:36886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odXKf-0008J9-Bl for larch@yhetil.org; Wed, 28 Sep 2022 09:42:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odViS-0003Ir-H4 for guix-patches@gnu.org; Wed, 28 Sep 2022 07:59:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odViS-0001ND-8n for guix-patches@gnu.org; Wed, 28 Sep 2022 07:59:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1odViR-0001HB-3h for guix-patches@gnu.org; Wed, 28 Sep 2022 07:59:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58140] [PATCH 3/6] gnu: Add vosk-api. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 28 Sep 2022 11:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58140 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 58140@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 58140-submit@debbugs.gnu.org id=B58140.16643663134834 (code B ref 58140); Wed, 28 Sep 2022 11:59:03 +0000 Received: (at 58140) by debbugs.gnu.org; 28 Sep 2022 11:58:33 +0000 Received: from localhost ([127.0.0.1]:60430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odVhw-0001Ft-G6 for submit@debbugs.gnu.org; Wed, 28 Sep 2022 07:58:32 -0400 Received: from 10.mo584.mail-out.ovh.net ([188.165.33.109]:57183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odVhn-0001F5-DS for 58140@debbugs.gnu.org; Wed, 28 Sep 2022 07:58:25 -0400 Received: from player787.ha.ovh.net (unknown [10.108.4.215]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 4CE8D2566F for <58140@debbugs.gnu.org>; Wed, 28 Sep 2022 11:58:21 +0000 (UTC) Received: from ngraves.fr (met42-h01-213-44-161-47.dsl.sta.abo.bbox.fr [213.44.161.47]) (Authenticated sender: ngraves@ngraves.fr) by player787.ha.ovh.net (Postfix) with ESMTPSA id 9CBBA2F48C4C3; Wed, 28 Sep 2022 11:58:18 +0000 (UTC) X-OVh-ClientIp: 213.44.161.47 Date: Wed, 28 Sep 2022 13:57:52 +0200 Message-Id: <20220928115755.6292-3-ngraves@ngraves.fr> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220928115755.6292-1-ngraves@ngraves.fr> References: <20220928115755.6292-1-ngraves@ngraves.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 3953034575818515170 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfeegkedggeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepudeivdeggeduudehheevjeeufffgueffkeelvdevffdvjefgueekkefhjeejiefhnecuffhomhgrihhnpehgihhthhhusgdrtghomhdprghlphhhrggtvghphhgvihdrtghomhenucfkpheptddrtddrtddrtddpvddufedrgeegrdduiedurdegjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhhtpdhhvghlohepphhlrgihvghrjeekjedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehnghhrrghvvghssehnghhrrghvvghsrdhfrhdpnhgspghrtghpthhtohepuddprhgtphhtthhopeehkedugedtseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkeeg X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches From: Nicolas Graves via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664372558; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=9a5lIfEBoW8OhpgbqlsRmnGet6Gho5TWzCH05zIJFsM=; b=GA+7OWGodYJMlFRsJtgAUQyqv+fGmNjY+2HrE7rxV591f+XlMoUHsE1RQ5HhtMP7PnrHPB 9VQRx84qLlI0kBEUcEF6AnGaRu7oleygK+8r9VHnoiD6tVXVXepow/y0tDeWTKrHuaLcDq XkFzyJC5wgnqrH/dbtedMDgCCONDmSemfj55yfCyoM2cbIdKa6gSCNrKffuvZiiaSPCnC5 9QBj/TmotjlyRjTlLmXG74VbvITda3GQrfJyTlkkdpepo6w3aHCFpOM+YGRjKYJffI8aTh MFxVEmQ1M3Azj91KzNtNz8taNs/8dsdgkJTLIN3EKKnxB1KXxfiJhZmKyFjhpw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664372558; a=rsa-sha256; cv=none; b=raub+cNjaU0DI88TXFYRSfxs7wsx6UwRvVzzMFh8KlayfvxDSnv4bq9ETYnVFa3xVxzynw 30tUoz5KUpHu2JUNCmgfaiBO5t8Uk/djF7V7+qtkNOWWMq/mQwAT7HZ9gc6aqmd3AvtaCU NLC/qIcFExHunEeYPSi71QochBwZIVsJ5Ws7C3Rqe8GgREk/qSzsmW4Jo1v8KwibjsB0Wa RONpYGrFZrB60qym50vus6CGhlBp8VtoOQWEKELebB0L+wNCZo1I68zU758VXGL8Mv3I3V zAJs4lYIiW4lUmUEUHfK3XpP/sxbeUDLvx67CliG8UGVJd9eug1z8NDb9xC0Dg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.85 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3C20BA83B X-Spam-Score: -2.85 X-Migadu-Scanner: scn1.migadu.com X-TUID: yMvgr2Dk1tnx * gnu/packages/machine-learning.scm (vosk-api): New variable. --- gnu/packages/machine-learning.scm | 74 +++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 9b2e01c102..df91a3a2ac 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -3485,3 +3485,77 @@ (define-public python-pyro-ppl "This package provides a Python library for probabilistic modeling and inference.") (license license:asl2.0))) + +(define-public vosk-api + (let* ((openfst openfst-for-vosk) + (kaldi kaldi-for-vosk)) + (package + (name "vosk-api") + (version "0.3.43") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/alphacep/vosk-api") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0xmp8i140c2hd3rj9dap8a2rnsvzb1k9hnqm12xzbaxrw73rkc29")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ (chdir "src") #t)) + (replace 'configure + (lambda _ + (substitute* "./Makefile" + (("USE_SHARED\\?=0") + "USE_SHARED?=1") + (("-DFST_NO_DYNAMIC_LINKING") + "") + (("-lopenblas -llapack -lblas -lf2c") + (string-append + "-L" #$openblas "/lib " "-lopenblas " + "-L" #$lapack "/lib " "-llapack -lblas ")) + (("-lfst -lfstngram") + (string-append + "-L" #$openfst "/lib " "-lfst -lfstngram ")) + (("\\$\\(HOME\\)\\/travis\\/kaldi") + #$(file-append kaldi "/include")) + (("\\$\\(KALDI_ROOT\\)\\/tools\\/openfst") + #$openfst) + (("\\$\\(KALDI_ROOT\\)\\/tools\\/OpenBLAS\\/install") + #$openblas) + (("\\$\\(KALDI_ROOT\\)\\/libs") + #$(file-append kaldi "/lib"))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + (src (string-append out "/src"))) + (mkdir-p lib) + (mkdir-p src) + (install-file "libvosk.so" lib) + (for-each + (lambda (x) (install-file x src)) + (find-files "." "\\.h$")))))))) + (inputs (list kaldi openfst lapack openblas)) + (home-page "https://alphacephei.com/vosk") + (synopsis "Speech recognition toolkit based on @code{kaldi}") + (description "\ +This package provides a speech recognition toolkit based on @code{kaldi}. It +supports more than 20 languages and dialects - English, Indian English, +German, French, Spanish, Portuguese, Chinese, Russian, Turkish, Vietnamese, +Italian, Dutch, Catalan, Arabic, Greek, Farsi, Filipino, Ukrainian, Kazakh, +Swedish, Japanese, Esperanto, Hindi, Czech, Polish. The program works offline, +even on lightweight devices. Portable per-language models are about 50Mb each, +and there are much bigger and precise models available. + +Vosk API provides a streaming API allowing to use it `on-the-fly' and bindings +for different programming languages. It allows quick reconfiguration of +vocabulary for better accuracy, and supports speaker identification beside +simple speech recognition.") + (license license:asl2.0)))) -- 2.37.3