Questions tagged [polyglot]

Multilingual text (NLP) processing toolkit for Python

From the homepage:

Polyglot is a natural language pipeline that supports massive multilingual applications.

Features:

  • Tokenization (165 Languages)
  • Language detection (196 Languages)
  • Named Entity Recognition (40 Languages)
  • Part of Speech Tagging (16 Languages)
  • Sentiment Analysis (136 Languages)
  • Word Embeddings (137 Languages)
  • Morphological analysis (135 Languages)
  • Transliteration (69 Languages)
111 questions
23
votes
1 answer

How to change the per-language configuration of setting "editor.insertSpaces" to "auto"

I'm using VS Code to edit projects in multiple languages (mostly Ruby, PHP and Javascript) and for each language we have different indentation models (spaces/tabs and width). Looks like VS Code supports this as it allows both editor.insertSpaces and…
Guss
  • 30,470
  • 17
  • 104
  • 128
16
votes
1 answer

What's the most complex/powerful code you can write that's valid in a maximum number of languages?

What's the most complex/powerful code you can write that's valid in a maximum number of languages? So, for example, the following code is valid in both PHP and JavaScript. function foo($bar) { $var = 0; for($i=0;$i<100;$i++) { $var += ($bar +…
Yahel
  • 37,023
  • 22
  • 103
  • 153
16
votes
3 answers

Can Perl and Batch run in the same batch file?

I've got a batch script that does some processing and calls some perl scripts. My question is if there was a way to put the perl code directly into the batch script and have it run both types of scripts.
Rick
  • 161
  • 1
  • 3
15
votes
2 answers

What languages are used in Stack Overflow's 404 polygot?

Currently, when a user here gets a 404, they see the following image: Which represents the text: # define v putchar # define print(x) main(){v(4+v(v(52)-4));return 0;}/* #>+++++++4+[>++++++<-]>…
SamB
  • 9,039
  • 5
  • 49
  • 56
13
votes
7 answers

Organizing the source code base when mixing two or more languages (like Java and C++)

I ran into a problem a few days ago when I had to introduce C++ files into a Java project. It started with a need to measure the CPU usage of the Java process and it was decided that the way to go was to use JNI to call out to a native library (a…
trshiv
  • 2,445
  • 21
  • 24
12
votes
2 answers

Error when using the command "from polyglot.detect import Detector"

I was playing with the polyglot function to convert the text from one language to another like Spanish to English. I was following the instructions to install the Polyglot and the required modules. But while running the code from polyglot.detect…
Rajni
  • 121
  • 1
  • 1
  • 6
11
votes
2 answers

Polyglot ImportError: cannot import name 'Locale' from 'icu'

I was trying to run the polyglot for my sentimental analysis. After a lot of struggling,, I successfully installed Polyglot and pyicu. However when I ran my program, it gave me this error, and I don't know how to fix it Traceback (most recent…
Siyi Zhou
  • 111
  • 1
  • 3
11
votes
2 answers

How can one create a polyglot PDF?

I like reading the PoC||GTFO issues and one thing I found remarkable when I first discovered it, was the "polyglot" nature of their PDF files. Let met explain: when you consider for example their 8th issue, you may unzip files from it; execute the…
Lery
  • 402
  • 3
  • 16
10
votes
5 answers

Can't install python Polyglot package on Windows

I'm trying to install Polyglot package by using the command: pip install polyglot and I receive the following: Collecting polyglot Using cached polyglot-15.10.03-py2.py3-none-any.whl Collecting pycld2>=0.3 (from polyglot) Requirement already…
Lior Magen
  • 1,533
  • 2
  • 15
  • 33
10
votes
11 answers

Polyglot Programming: Is building applications with multiple languages a good practice?

I am considering building an application that is a blend of a dynamic language (python or ruby) and compiled language and need some help getting convincing myself that this is a good idea. My thought are that I can use a dynamic language to get a…
Nick Haddad
  • 8,767
  • 3
  • 34
  • 38
7
votes
3 answers

Pip can't install pyicu

I am running a AWS that runs Ubuntu 20.04. I am trying to install the package pyicu, but I am facing problems. I tried running sudo apt install libicu-dev, but I still can't install pyicu. I am not able to install brew on the aws server. Any other…
Petar
  • 113
  • 1
  • 7
6
votes
2 answers

How to apply Polyglot Detector function to dataframe

Assuming I have a column called df.Text which contains text (more that 1 sentence) and I want to use polyglot Detector to detect the language and store the value in a new column df['Text-Lang'] how do I ensure I also capture the other details like…
mobcdi
  • 1,532
  • 2
  • 28
  • 49
5
votes
0 answers

Error received when trying to install library 'pycld2' on Windows 10

Trying to install pycld2 (need it for polyglot) and I receive the following error: [WinError 2] The system cannot find the file specified Looking for a solution if someone else faced same issue. Thank…
crbl
  • 379
  • 2
  • 13
5
votes
1 answer

extending NLP entity extraction

We would like to identify from a simple search neighborhood and streets in various cities. We don't only use English but also various other Cyrillic languages. We need to be able to identify spelling mistakes of locations. When looking at python…
Dory Zidon
  • 10,497
  • 2
  • 25
  • 39
5
votes
1 answer

Powershell: Read a section of a file into a variable

I'm trying to create a kind of a polyglot script. It's not a true polyglot because it actually requires multiple languages to perform, although it can be "bootstrapped" by either Shell or Batch. I've got this part down no problem. The part I'm…
BHarms
  • 198
  • 1
  • 9
1
2 3 4 5 6 7 8