Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMR preprocessing fails #2

Closed
danielhers opened this issue Feb 11, 2020 · 4 comments
Closed

AMR preprocessing fails #2

danielhers opened this issue Feb 11, 2020 · 4 comments

Comments

@danielhers
Copy link

Could you please explain how to properly install the requirements for AMR preprocessing? I tried installing JAMR from GitHub but it fails. Did you install it from a different location?

@longxudou
Copy link
Owner

The original JAMR was installed in 2015 or 2016 in HPC, thus some packages were broken or not updated. The default setup script in JAMR repos is set to a version no longer available.

Today, I have installed JAMR again on my Macbook(Mojave 10.14.6) and uploaded new version in JAMR.

Here are the details:
First, please ensure the following env:
JAVA=8.0 (Download from oracle website)
sbt=1.0.2, scala=2.11.8 (Use SDKMAN! to install, like sdk install scala 2.12.1 )

Then, modify these files:

  • jamr/project/build.properties:

sbt.version=1.0.2

  • jamr/build.sbt:

// import AssemblyKeys._
// assemblySettings
name := "jamr"
version := "0.1-SNAPSHOT"
organization := "edu.cmu.lti.nlp"
scalaVersion := "2.11.8"
crossScalaVersions := Seq("2.11.8","2.11.12", "2.12.4","2.10.6")
libraryDependencies ++= Seq(
"com.jsuereth" %% "scala-arm" % "2.0",
"edu.stanford.nlp" % "stanford-corenlp" % "3.4.1",
"edu.stanford.nlp" % "stanford-corenlp" % "3.4.1" classifier "models",
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2",
"org.scala-lang.modules" %% "scala-pickling" % "0.10.1"
// "org.scala-lang" % "scala-swing" % "2.10.3"
)

  • jamr/project/plugins.sbt:

resolvers += "Sonatype releases" at "https://oss.sonatype.org/content/repositories/releases"
resolvers += "Sonatype snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/"
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6")
// addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0")
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")

@longxudou longxudou added the good first issue Good for newcomers label Feb 13, 2020
@longxudou longxudou pinned this issue Feb 13, 2020
@longxudou longxudou unpinned this issue Feb 13, 2020
@longxudou longxudou removed the good first issue Good for newcomers label Feb 13, 2020
@longxudou longxudou reopened this Feb 13, 2020
@danielhers
Copy link
Author

Thanks!

For JAMR to work,

  • I think I had to run sbt before running ./setup in the JAMR directory.
  • CDEC should be ${JAMR_HOME}/tools/cdec, right? It was failing due to Invalid range "\x{0CE6}-\x{0BEF}" in transliteration operator at ./tools/cdec/corpus/support/quote-norm.pl line 149., so I deleted line 149 there (it handles Tamil numerals).
  • I also had to change scala-2.10/jamr-assembly-0.1-SNAPSHOT.jar to scala-2.11/jamr-assembly-0.1-SNAPSHOT.jar in the JAMR configs in scripts for the CLASSPATH to be right.

And for TAMR to work,

  • I had to convert the GloVe file to word2vec format to make it loadable by Gensim: python -m gensim.scripts.glove2word2vec --input glove.840B.300d.txt --output glove.840B.300d.w2vformat.txt.
  • I needed to run import nltk; nltk.download('stopwords') in Python.

@mhany90
Copy link

mhany90 commented Feb 17, 2020

Installation now succeeds. However, on trying to run the 'amr_preproccess.sh' script I am getting the following error:

######## running tamr rule based aligner ...
WARN: use slow version of smatch api.
WordVec is loaded.
Traceback (most recent call last):
  File "/Users/mabdou/Desktop/phd/mr/mrc/parsers/HIT-SCIR-CoNLL2019/bash/../toolkit/tamr_aligner/rule_base_align.py", line 329, in <module>
    main()
  File "/Users/mabdou/Desktop/phd/mr/mrc/parsers/HIT-SCIR-CoNLL2019/bash/../toolkit/tamr_aligner/rule_base_align.py", line 323, in main
    align(opt)
  File "/Users/mabdou/Desktop/phd/mr/mrc/parsers/HIT-SCIR-CoNLL2019/bash/../toolkit/tamr_aligner/rule_base_align.py", line 120, in align
    graph = Alignment(block)
  File "/Users/mabdou/Desktop/phd/mr/mrc/parsers/HIT-SCIR-CoNLL2019/toolkit/tamr_aligner/amr/aligned.py", line 113, in __init__
    self.graph, self.attributes = self._get_graph(block)
  File "/Users/mabdou/Desktop/phd/mr/mrc/parsers/HIT-SCIR-CoNLL2019/toolkit/tamr_aligner/amr/aligned.py", line 251, in _get_graph
    for t in graph.triples():
**TypeError: 'list' object is not callable**
######## refreshing alignments ...
Traceback (most recent call last):
  File "/Users/mabdou/Desktop/phd/mr/mrc/parsers/HIT-SCIR-CoNLL2019/bash/../toolkit/tamr_aligner/refresh_alignments.py", line 47, in <module>
    main()
  File "/Users/mabdou/Desktop/phd/mr/mrc/parsers/HIT-SCIR-CoNLL2019/bash/../toolkit/tamr_aligner/refresh_alignments.py", line 18, in main
    assert len(lines) == 2
AssertionError
######## generating oracles ...
WARN: use slow version of smatch api.
######## adding extra mrp information ...
1
Traceback (most recent call last):
  File "/Users/mabdou/Desktop/phd/mr/mrc/parsers/HIT-SCIR-CoNLL2019/bash/../toolkit/amr_add_extra.py", line 39, in <module>
    amr_add_extra(args.input, args.output, args.extra)
  File "/Users/mabdou/Desktop/phd/mr/mrc/parsers/HIT-SCIR-CoNLL2019/bash/../toolkit/amr_add_extra.py", line 26, in amr_add_extra
    print(i, eid)
UnboundLocalError: local variable 'eid' referenced before assignment

@danielhers
Copy link
Author

@mhany90 since Penman version 0.7.0, penman.Graph.triples is now a member variable instead of a method. So make sure to pip install 'penman<0.7'.

ZhaofengWu pushed a commit to ZhaofengWu/HIT-SCIR-CoNLL2019 that referenced this issue Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants