Implementation of a dictation system using Sphinx4 and Python - java

I want to develop a dictation system using Sphinx4. After some search, I realize that the language that it's better to use is Java. Can I combine Sphinx4 with Python? I prefer Python because I want to enhance my system by adding neural network techniques in the language model and apply domain classification. Also, I read about pocket-sphinx and pypi but pocket-sphinx is said to be for portable lightweight applications while my application will run on the cloud and I will have enough computing power to support a better model.

For cloud applications it's better to use something like https://github.com/alumae/kaldi-gstreamer-server

Related

Is there any drawbacks of using Apache Kafka with python instead of Java?

I am developing an application in python and I have to use Apache-Kafka. I am very new to Kafka.
I read that python does not support transactional producer/consumer of Kafka. I just wanna know that will this flaw make any huge difference because of which I have to convert my python application to java and then use Kafka? Also is there any other drawback of using Kafka-python?
Actually confluent-kafka’s python library uses librdkafka underneath and as of latest version it does support exactly once semantics so no worries about that. For my knowledge there is no practical limitations of using python client but official java client has battery of features regarding stream support and custom partitioners(for producers) and other features so if you have a choice or you think python apps performance won’t be enough that start with java otherwise there are no drawbacks.
You can find a nice comparison of official clients here.

Is it possible to write NetLogo simulation programs in Java?

I am trying to develop NetLogo model (consumer research), but I would like more control over what agents (turtles) are and what they can do, therefore I would like to write code in Java, import Java libraries, possibly, use rules engine and so on. Is that possible in NetLogo?
If not, then what other agent modelling frameworks with Java programming capabilities are?
It is possible with NetLogo using the Extensions API. With this API, you write your overall model in NetLogo, making calls into your Java-based routines as needed. (You cannot call a Java library directly from NetLogo code; rather, you write an extension that exposes the routines in that library as NetLogo primitives, and then you use those primitives in your model.) A look at the NetLogo extensions download page should give you an idea of the diverse sorts of things are possible with this API.
See also: Integrating NetLogo and Java : when should we think about this integration as a good option?.
Two notable agent-based modeling frameworks where you write your entire model in Java are Repast and MASON.

Is there any framework to have Java and Php interoperability?

I have a few modules of an application that have been written in Java. But now, I have been asked to write all the other modules in PHP.
Is there any tool that will permit me to make method calls from PHP to Java and vice versa?
If not, is it possible to develop one especially considering the fact that Java is a strongly typed language unlike PHP?
Without knowing more I would suggest that you expose the Java methods as a web service. This has a number of other benefits outside of just language independent consumption.
However, web services might not be the answer if your java modules are very granular.
You might find it easiest if you use one of the solutions that enables you to run PHP on the JVM. This should give you pretty good interoperability. e.g.
http://www.caucho.com/resin-3.0/quercus/
Having said that, if you're already using Java modules, I can't see a huge amount of value in adding PHP into the mix as well. Why not just stick with Java? Java is already pretty much the best all-round platform choice for server side applications once you consider things like library ecosystem, tools, portability, performance, maturity, maintainability etc.
You can use nice frameworks like Play (Java/Scala) or Grails (Groovy) or Noir (Clojure) if you want productive web development on top of the Java stack, I think I would choose these in preference to most of the PHP frameworks available.

Sphinx4 vs Pocketsphinx

What's the easiest way to run a program written in sphinx4 on pocketshpinx?
I need something that can be used on various mobile platforms, like the iphone and android phones.
I have already written demos in sphinx4 in Java, but now I need them to be in C.
Thanks:)
From official documentation
Flexibility of sphinx4 allows you to build such a system quickly. It's
easy to embed sphinx4 into flash server like red5 to provide web-based
recognition, it's easy to manage many sphinx4 instances doing
large-scale decoding on a cluster.
On the other side, if your system needs to be efficient and reasonably
accurate, if you are running on embedded device or you are interested
in using recognizer with some exotic language like Erlang,
pocketsphinx is your choice. It's very hard to integrate Java with
other languages not supported by JVM pocketsphinx is way better here.
in conclusion
need speed or portability -> use pockesphinx
need flexibility and managibility -> use sphinx4
TL;DR - use pocketshpinx
Use a C library if you plan to develop application on multiple platforms. Both Android (via NDK) and iOS(natively) support loading and calling C library. There is no JVM on iOS, thus, you won't be able to use sphinx on iOS.
To save time, pocketphinx-android-demo github repo has precompiled pocketsphinx libraries for all the relevant platforms -
https://github.com/cmusphinx/pocketsphinx-android-demo/tree/master/app/src/main/jniLibs
You get both performance and potability(you have to compile for arm and x86) with C/C++ libraries. Here is a Dropbox, Inc. talk on how they use C++ for writing multi platform applications.
https://www.youtube.com/watch?v=ZcBtF-JWJhM
If you wrote a JNI wrapper around pocketsphinx, then you could use that from your java code.
There are also python language bindings for pocketsphinx.
Essentially pocketsphinx is the speech recognizer you should use if you want a C language speech recognizer (and is also the one designed to be fast enough to work on a mobile phone).
Sphinx4 and PocketShpinx are completely different regarding implementation, you have to rewrite the demos or worse they might be not supported in PocketSphinx. That happens if you use some Sphinx4 advanced features.

Is Java or Python better for writing a web-page-source-checking web service on Google App Engines?

I hope you all have a nice day.
I want to write a web service that would check some web page HTML code every 20 minutes and e-mail it to my mail box. Here I was given a suggestion to use Google App Engine for this task. Having briefly read through that site I learned that two languages could be used there: Java and Python.
Which one do you think would fit best for my task and, therefore, I would have to start learning? (I don't know either language).
Both the languages and their App Engine implementations are pretty solid and mature. As a language, Python is faster to learn, but Java comes with richer tools such as Eclipse that may partly compensate. A lot depends on what other languages you have background in -- for example, coming from C#, Java would be simpler than for somebody coming from, say, C. For such a simple task, the issues of power of the two languages and additional libraries &c doesn't really come into play.
I've tried both languages with GAE and here's my general feeling about the choice of language for it:
Python is generally simpler. So, if you're using bare GAE API, Python's one is simpler to learn and simpler to write a webapp in it.
Java is more compatible. Python's API is generally GAE-specific, while Java API resembles some standard Java technologies (servlets, JDO, deployment etc.)
So, Java is a good choice if you either have an experience with web development in Java or if you're going to use third-party libraries extensively. Otherwise, Python is better.
For your particular task, I'd suggest Python, mostly because of the existence of Beautiful Soup, an excellent HTML parser that handles poorly formed documents.

Categories

Resources