Message Boards Message Boards

Import text with SemanticImport?

Hello All. I have been trying to run the command SemanticImport, but it won't work. I always get an error and no output. When I try to do the simple import of the same data it works. I have no idea what else to do. Has anyone experienced the same situation or has a solution for that? Thank you

In[16]:= data1 = Import["ExampleData/50states.txt", "Data"];
First[data1]

Out[17]= "Alabama"
In[18]:= data2 = SemanticImport["ExampleData/50states.txt"];
First[data2]

During evaluation of In[18]:= SemanticImport::unexpinvaliderr: Unexpected invalid input was detected.  Processing will not continue

During evaluation of In[18]:= First::normal: Nonatomic expression expected at position 1 in First[$Failed].

Out[19]= First[$Failed]
In[20]:= $Version

Out[20]= "11.2.0 for Microsoft Windows (64-bit) (September 11, 2017)"
POSTED BY: Luciano Pinheiro
6 Replies
Posted 6 years ago

Try backing up and removing $UserBaseDirectory.

POSTED BY: Sean Cheren

I think I might have an old version of the Paclet,

Your version seems fine, I have the same:

"Version" /. PacletInformation["SemanticImport"]
(* ==> "0.0.458" *)

Try removing "SemanticImport" from your machine and the re-run SemanticImport["ExampleData/50states.txt"]. If you are on Windows, it should be here: C:\Users\*username*\AppData\Roaming\Mathematica\Paclets\Temporary. Beware, AppData is a hidden folder.

POSTED BY: Mikayel Egibyan

I think I might have an old version of the Paclet,

In[9]:= "Version" /. PacletInformation["SemanticImport"]

Out[9]= "0.0.458"

But, when try the command

PacletUpdate["SemanticImport"]

Nothing shows...

POSTED BY: Luciano Pinheiro

Even after getting Mathematica 11.3, SemanticImport command won't work. Even if I copy straight from the Wolfram page, I keep getting the same error.

In[3]:= data2 = SemanticImport["ExampleData/50states.txt"];
First[data2]

During evaluation of In[3]:= SemanticImport::unexpinvaliderr: Unexpected invalid input was detected.  Processing will not continue

During evaluation of In[3]:= First::normal: Nonatomic expression expected at position 1 in First[$Failed].

Out[4]= First[$Failed]
POSTED BY: Luciano Pinheiro

Thank you, Mikayel. I did updated to the latest version 11.3 and still shows the same error

POSTED BY: Luciano Pinheiro

Hi,

Please download the latest (11.3) version of Mathematica.

$VersionNumber
(* ==> 11.3` *)
data2 = SemanticImport["ExampleData/50states.txt"]; 
First[%]
(* ==> "Alabama, United States"Entity["AdministrativeDivision", {"Alabama", "UnitedStates"}]"Entity[\"AdministrativeDivision\", {\"Alabama\", \"UnitedStates\"}]""administrative division" *)

Best, Mikayel

POSTED BY: Mikayel Egibyan
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract