ImportError: cannot import name 'SnliReader' from 'allennlp.data.dataset_readers' - importerror

I am beginner in understanding Allennlp framework.
I tried the code given in medium post https://medium.com/analytics-vidhya/fine-tuning-bert-with-allennlp-7459119b736c.
But, got an ImportError: cannot import name 'SnliReader' from 'allennlp.data.dataset_readers'
Does any one know why this error is showing?

It looks like that blog post is based on an older version of allennlp. For version 2.x, the SnliReader can be found in the allennlp-models package; specifically at allennlp_models.pair_classification.dataset_readers.snli.

Related

Can't use pyrevit forms

I am trying (for a long time) to use pyrevit forms to open excel files, but everytime I try to use it, a different error appears. The most recent error is the one in the image.
If I try 'from pyrevit import *', the error is:
Exception : System.MissingMemberException: 'module' object has no attribute 'compat'
Does anyone have any idea what I'm doing wrong? I don't know what else to do... Sorry for my ignorance.
Thank you very much in advance!
new error message:
It looks like some links are missing. Have you tried reinstalling .NET Framework or pyrevit?
The problem may be with from pyrevit import * because it is not in your PATH. I was able to use pyRevit forms by adding its library and additional packages folders like this:
import sys
sys.path.append(r'C:\Users\<username>\AppData\Roaming\pyRevit-Master\pyrevitlib')
sys.path.append(r'C:\Users\<username>\AppData\Roaming\pyRevit-Master\site-packages')
from pyrevit import forms
Just replace <username> and paste into RevitPythonShell, provided pyRevit is installed in the default location. Other pyrevit modules should work similarly.

"ModuleNotFoundError: No module named 'PIL'

I have the same problem as was asked by trevor however the answers don't assist me at all.
I'm on Window 10, running Pyscriper 3.6.3.0 and Python 3.8.2 in 32 bit.
I've searched the Pillow site and those instruction just result in a different error where pip is invalid syntax. The biggest issue I'm finding is that there is way too much out of date on Google and the forums.
I was of the belief that Pillow already came with 3.8.2?
from tkinter import *
from PIL import ImageTk,Image
root = Tk()
root.title('TimeLord Frames')
root.iconbitmap('TBA') # Still need to work on icon.
frame = LabelFrame(root, text="This is my Frame.., padx=5, pady=5")
frame.pack(padx=10, pady=10)
b = Button(frame, text="Click Here")
b.pack()
root.mainloop()
I'm pretty sure I have found the problem. It comes from the line:
root.iconbitmap('TBA') # Still need to work on icon.
Because I haven't resolved an issue with the icon, it is looking at "from PIL import ImageTk,Image" and not connecting the 2 together. I have tried inserting the location of my icon, but it's not happy with that either. If I # out bothe line refering to images, I can get the program to run.
Cheers

what's the difference between eyed3 and eyeD3, and how can i edit mp3 tags with python

I'm trying to update my mp3 tags through python.
I've downloaded eyed3, but i can only import eyed3 and not eyeD3.
I saw some options for code with eyeD3 that do what i need. for example something like:
tag = eyeD3.Tag()
tag.link(mp3_file_name)
tag.setVersion([2,3,0])
tag.setArtist(u'\u897f\u306f\u3058\u3081')
tag.update()
But i can't do that with eyed3.
Does someone knows what's the difference between eyed3 and eyeD3 and how can i download eyeD3?
Or does anyone knows a different way to edit tags for mp3 file?
Thanks a lot.
In the latest version i.e eyeD3 0.8 the import module has been changed from
import eyeD3 to import eyed3
and the usage is :
import eyed3
audio = eyed3.load(PATH_TO_YOUR_MP3)
#To retrieve Data
print audio.tag.artist
print audio.tag.album
print audio.tag.title
#To set Data
audio.tag.artist = u"ARTIST"
audio.tag.album= u"ALBUM"
audio.tag.title= u"TITLE"
audio.tag.save()
I'm not sure what the difference is, I believe its actually the same package, eyed3 works as you require, you just need to pass save rather than update:
audiofile = eyed3.load("song.mp3")
audiofile.tag.artist = u"Nobunny"
audiofile.tag.album = u"Love Visions"
audiofile.tag.album_artist = u"Various Artists"
audiofile.tag.title = u"I Am a Girlfriend"
audiofile.tag.track_num = 4
audiofile.tag.save()
eyeD3 is the command-line tool (e.g. eyeD3 --help), and eyed3 is the Python you can import. They are both part of the eyeD3 PyPI package.
Note, older versions of this software did name the module eyeD3 but this changed in version 0.7.

Typo3 Tree Import fail

I'm using Typo3 6.2 and I want move my Projekt to another Computer with Typo3 6.2 but I'm failing to import the tree structure ...
When I'm import a single page it works but when if the page has a subpages it doesnt work.
After I uploading a receive this Error:
"Possible error: pages:15 had no new id assigned to it. This indicates that the record was not added to database during import. Please check changelog!"
Here is the import file, maybe it just doesnt work on my system...
File leist.t3d
means
I had this error, too.
In my case, I got an error message after enabling error messages, it was a missing field in table "pages", after a "DB compare", the import worked.
Not sure, but is sounds like a known bug:
https://forge.typo3.org/issues/59055
Or more specific (copy pasted from that bug):
When I change uniqid('NEW'); to uniqid('NEW', TRUE); in class
ImportExport the functional tests aren't failing and I assume
introduction extension is imported correctly (no errors in typo3.log).
(again not totally certain) but you might wanna patch it for testing or fetching a patched source for
/typo3/sysext/impexp/Classes/ImportExport.php

Importing library in Dart on Windows

I've been trying to make a library in Dart and import it in my project. Though for some reason it won't do it.
Here's how it looks:
It says it can't find the library, though the path is correct. I also tried a bunch of other paths:
SmartCanvas.dart
SmartCanvas/SmartCanvas.dart
SmartCanvas
SmartCanvas/SmartCanvas
./SmartCanvas/SmartCanvas.dart
../SmartCanvas/SmartCanvas.dart
./SmartCanvas.dart
../SmartCanvas.dart
./SmartCanvas
../SmartCanvas
Note: The project I'm trying to import this library into is located somewhere totally different on my harddrave (my dropbox folder.)
Anyone knows what I should use as path, or how I can import the library properly?
Thanks!
#import expects a full path or correct relative path to a .dart file that has the #library line.
Here is an example from working code:
https://github.com/johnmccutchan/DartVectorMath/blob/master/test/console_test_harness.dart
At the top you see #import('../lib/vector_math_console.dart');
which is located:
https://github.com/johnmccutchan/DartVectorMath/blob/master/lib/vector_math_console.dart
Chopping off the github url prefix, we are left with:
test/console_test_harness.dart
lib/vector_math_console.dart
The import line uses the correct relative path from test/ into ../lib/ to find vector_math_console.dart (the library).
HTH,
John
Try this for windows
#import('/c:/users/pablo/pablo\'s documents/projects/smartcanvas/smartcanvas.dart');
To import local libraries in dart, I'd recommend using the the path dependency in the pubspec.yaml. This is a much cleaner approach then embedding absolute paths in the dart code.
Read about it here: https://www.dartlang.org/tools/pub/dependencies.html#path-packages