How to make an offline translator? [closed] - neural-network

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
**Problem: **
The result must be a working translator - offline.
We need http API (self-hosted) similar to Google Translate.
I found a few options:
Install Microsoft Translator on Windows, download dictionaries, and somehow through http transfer requests for translation there
Apertium, this option is closer to reality, but it’s not clear how to set everything up ...
Apache Joshua
Promt, it is perfect but it is very expensive
Install Android on PC, and there is already Google Translate, but again there will be a question of sending http requests
**Todo: **
We need to translate whole sentences, not just individual words.
Maybe there is some kind of command line utility. Or maybe there is something for linux.
Which of the above options is better to look for more information?

The five-minute solution is to do this on Debian or Ubuntu:
sudo apt install apertium-apy # http server for apertium
sudo apt install apertium-eng-spa # install some language data
sudo systemctl enable apertium-apy # start http server on next boot
sudo systemctl start apertium-apy # start http server right now too
You now have translation between English and Spanish that responds to http requests and answers in JSON:
curl 'http://localhost:2737/translate?langpair=spa|eng&q=Eres+la+leche'
You can see all the apt-installable Apertium language pairs with
apt-cache search apertium |grep 'pair$'
If you want more pairs in Apertium, you could try the adding the nightly apt repo with unreleased data (or consider Contributing your own language data).
However, you tagged this neural-network – if you want NN's, or more language pairs than Apertium has, you could train a translator with OpenNMT and data from e.g. http://opus.nlpl.eu/ , but that will definitely take more than five minutes :-)

Related

Raspberry pi NTP working without conf file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
On raspberry, I was looking at the NTP configuration file under /etc/systemd/timesyncd.conf. All lines are commented (by default) but when I run the timedatectl status command, I get:
...
Network time on : yes
NTP synchronized : yes
...
How NTP works without configuration in conf file ? Where are NTP server links ?
Raspberry pi 3 ; Raspbian 9.13 (stretch)
The NTP management of systemd is called systemd-timesyncd. On my Ubuntu system, the corresponding systemd service is /lib/systemd/system/systemd-timesyncd.service. Typically, when you don't have items activated in a configuration file, daemons use default values. Moreover, if you look at the comment in the configuration file, you will see that the commented items are actually default values:
Entries in this file show the compile time defaults.
You can change settings by editing this file.
Defaults can be restored by simply deleting this file.

Run Perl script in SunOS machine [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
We have a SunOS machine where we run our daily jobs, on failures we usually login into the machine (using Putty) and run a perl script that take an input parameter to start the failed jobs. Similarly if we need to stop a job we follow the same process and run another script.
I would like to formulate a single script outside of the remote machine which would follow the process of logging in , navigating to the directory where the script is and running the script.
Just looking for ideas as to see how i can implement this
I would recommend looking into Net::OpenSSH (https://metacpan.org/pod/Net::OpenSSH). I've used this with great success to connect to remote machines, execute commands, and capture their output. Also, connection creation can be greatly simplified if you set up passwordless authentication to your remote machines. Then you can test your commands from the command line (and chain commands together):
ssh host 'cd dir1/dir2 && run_script'
The implementation in the controlling script would be to the tune of:
my $ssh = Net::OpenSSH->new($my_host);
my ($out, $err) = $ssh->capture2($my_command);

how to install initctl on a centos-7 box [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
service autofs restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service autofs restart
/etc/init.d/autofs: line 54: initctl: command not found
I have looked up on the web and do not see any yum package that can install initctl. can you please help.
CentOS 7 comes with systemctl to manage service. You don't need to use initctl.
service autofs restart should point to systemctl restart autofs
You can check the status of this service with systemctl status autofs and post us the output if not able to restart.

Automated Putty Program? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I have multiple Linux vps's and I need to be able to run a program that executes a command on the servers at the same time, or with minor delay. If someone could point my in the right direction that would be great. Thanks.
In bash, you can run a task in the background by appending & after the command. I would write a script to execute the command on the different servers:
#!/bin/bash
for server in server1.domain server2.domain server3.domain
do
ssh username#$server "mycommand params"&
done
This is for manual execution of a task on a number of remote machines. Of course, you will need to be using public key authentication (not password) otherwise it will hang on the password prompt.
If instead you meant that you want a regularly scheduled task to run on each individual machine, use cron as another answer suggested.

How to supervise a webserver with daemontools? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
How should I script daemontools superviser?
I've started to use D. J. Bernsteins' daemontools to keep some processes running and is working fine. But now I need to monitor a couple of additional conditions on those processes and I've failed to find good info on how to do that.
My scenario is that I have some processes running for a web app (pharo smalltalk virtual machines) and they respond http, each one in their port (that's for the for loadbalance). I would like to somehow ping those to verify that they are not only running but responding to http requests. If they don't respond in a certain way to a request for more than 30s they should be treated as crashed and simply be restarted.
Is this even possible with daemontools? if so, how should I write this script and where should I place it? or where's the documentation on this?
The simplest solution is to create another daemontool task with a script that sleeps for 30 seconds and then tests for the presence of the service (using wget or curl for example). If the service doesn't respond timely you can restart the service (svc -t yourapp) and/or send a notification. The run-script of the new service could look as simple as this:
#!/bin/sh
sleep 30
if ! wget --quiet --timeout=5 --delete-after "http://yourapp.com/" ; then
svc -t /etc/service/yourapp
fi
I've also made good experience with tools like Munin. Again you need to provide a script that provides information about the state of your image. If you setup your images with a REST service you can even provide really interesting metrics such as active sessions, inactive session, gc parameters, memory consumption, database statistics, ... The tool then draws nice graphs over time and lets you specify boundaries to get notified when things behave badly.
To detect if the service is responsive, you can use curl (a perfect fit for HTTP and command-line/shell scripts)
curl --connect-timeout 10 http://8.8.8.8
curl: (28) connect() timed out!
and you can write more sophisticated things, like checking that the response is 200 (OK) etc.