Message Boards Message Boards

GROUPS:

Import text with SemanticImport?

Posted 6 months ago
718 Views
|
7 Replies
|
4 Total Likes
|

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)"
7 Replies

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

<Accidental Duplicate>

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

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]

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...

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 6 months ago

Try backing up and removing $UserBaseDirectory.

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