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

How to get SRL result in retrieved triples ? #7

Closed
therealhieu opened this issue Sep 29, 2020 · 4 comments
Closed

How to get SRL result in retrieved triples ? #7

therealhieu opened this issue Sep 29, 2020 · 4 comments

Comments

@therealhieu
Copy link

image
HttpResponse receive through API server currently does not contain SRL arguments (SpatialArgument and TemporalArgument).

Can you guide me a way to get those arguments?

@aliozts
Copy link

aliozts commented Apr 6, 2021

I'd like to know as well.

@glory-99
Copy link

I'd like to know, too.

@aliozts
Copy link

aliozts commented Apr 21, 2021

Hello @glory-99 and @Hieudepchai , I am not a scala developer by no means so please take what I'll say with a pinch of salt, but I have came up with something

After checking the code, I have found out that what we see in the response is the class variables for the Argument in Extraction.scala (path is in the first section). For the Spatial and Temporal locations, the displayText parameter is changed so that when it is displayed (check the code that it is in the top of Extraction.scala. It will be printed respectively. So what I did is just adding an attribute typ to the class and changed it in the others,

  1. Find the src/main/scala/edu/knowitall/openie/Extraction.scala
  2. Change the Argument class to
abstract class Argument extends Part{
  val typ = "Simple"
}
  1. Add the typ (name it whatever you want, that will be what you'll see next to text in your http response
case class SpatialArgument(text: String, offsets: Seq[Interval]) extends Argument {
  override def displayText = "L:" + text

  override val typ = "Spatial"
}

case class TemporalArgument(text: String, offsets: Seq[Interval]) extends Argument {
  override def displayText = "T:" + text

  override val typ = "Temporal"
}

After doing this, you need to recompile etc. and it should work, i guess

@glory-99
Copy link

glory-99 commented May 7, 2021

Hello @glory-99 and @Hieudepchai , I am not a scala developer by no means so please take what I'll say with a pinch of salt, but I have came up with something

After checking the code, I have found out that what we see in the response is the class variables for the Argument in Extraction.scala (path is in the first section). For the Spatial and Temporal locations, the displayText parameter is changed so that when it is displayed (check the code that it is in the top of Extraction.scala. It will be printed respectively. So what I did is just adding an attribute typ to the class and changed it in the others,

  1. Find the src/main/scala/edu/knowitall/openie/Extraction.scala
  2. Change the Argument class to
abstract class Argument extends Part{
  val typ = "Simple"
}
  1. Add the typ (name it whatever you want, that will be what you'll see next to text in your http response
case class SpatialArgument(text: String, offsets: Seq[Interval]) extends Argument {
  override def displayText = "L:" + text

  override val typ = "Spatial"
}

case class TemporalArgument(text: String, offsets: Seq[Interval]) extends Argument {
  override def displayText = "T:" + text

  override val typ = "Temporal"
}

After doing this, you need to recompile etc. and it should work, i guess

I'll have a try, thanks!

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