-
Notifications
You must be signed in to change notification settings - Fork 13
More StackOverFlow posts / recommendations #432
Comments
Which recommender are you using? |
Actually, I realize that I don't get the same posts depending on the code. You will say, "Of course!" For example if I ask recommendations on this code:package openweather.json_simple; import java.io.IOException; import org.json.simple.parser.JSONParser; public class App {
}I don't get the same posts if I add before the code about the URL access: ============= import java.io.BufferedReader; import org.json.simple.JSONObject; public class App {
} |
Yes, I got it. But which recommender are you using? The KB has multiple recommenders and only four are created by us, all of them called CROSSIndex (there is one for Java, C, PHP and JavaScript). If you're using other recommenders, those are created by UDA and they are not connected to the Indexes that we generate. UDA decided to create their own indexes with specific dumps of data. |
Oh?! In the present case, I'm calling the recommender used by the Eclipse Plugin when you select the item: "Request API documentation and Q&A posts". |
That's a UDA recommender, so I cannot help you. I'll put Juri as the assigned to the issue. |
Yes, that is how SORec works. The import statements also have a role in the selection of SO posts.
Sent with something mobile
…________________________________
From: Philippe Krief <[email protected]>
Sent: Saturday, November 23, 2019 8:50:27 PM
To: crossminer/scava <[email protected]>
Cc: Subscribed <[email protected]>
Subject: Re: [crossminer/scava] More StackOverFlow posts / recommendations (#432)
Actually, I realize that I don't get the same posts depending on the code. You will say, "Of course!"
Unfortunately, for our example, it is a shame.
For example if I ask recommendations on this code:
package openweather.json_simple;
import java.io.IOException;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
public class App {
static String OpenWeathermapAPI = "http://api.openweathermap.org/data/2.5/weather?q={city}&appid=abbcea2020f75409af198b98de40e3a6";
public static void main(String[] args) throws IOException, ParseException {
// Parsing of the API result
JSONParser parser = new JSONParser();
}
}
I don't get the same posts if I add before the code about the URL access:
=============
package openweather.json_simple;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
public class App {
static String OpenWeathermapAPI = "http://api.openweathermap.org/data/2.5/weather?q={city}&appid=abbcea2020f75409af198b98de40e3a6";
public static void main(String[] args) throws IOException, ParseException {
// Creation of the REST API
String city = (args.length != 0)? args[0]:"Toulouse";
String restAPI = OpenWeathermapAPI.replace("{city}", city);
URL url = new URL(restAPI);
// Access to the REST API
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setConnectTimeout(5000);
con.setReadTimeout(5000);
int status = con.getResponseCode();
if (status == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
try {
// Parsing of the API result
JSONParser parser = new JSONParser();
JSONObject jsonObject = (JSONObject) parser.parse(in);
} finally {
in.close();
}
}
}
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#432?email_source=notifications&email_token=AAPPAEARDLVOWWZ2QHZYQZDQVGCQHA5CNFSM4JQ3SEBKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE74NDY#issuecomment-557827727>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAPPAEDU66Z6UMMRWMCZVATQVGCQHANCNFSM4JQ3SEBA>.
|
@davidediruscio do you mean that StackOverFlow API provides only the 5 first posts of a request? |
None of the recommenders is connected to StackOverflow API. All, including ours, make use of dumps. I'm sure Davide was referring to other stuff. |
Hi @creat89 , do you mean that the StackOverFlow posts we get come from our KB? If not fro where do they come from if they don't come from a StackOverFlow API? I don't understand what you mean by "dumps" |
Yes, the SO posts come from files that have been processed and indexed by the KB. The KB doesn't connect itself to StackOverflow servers. And I refer to dumps to the file that every three months more or less the owners of Stack Overflow publish (a huge XML file that contains all the information from SO https://archive.org/details/stackexchange). |
Hi Philippe, If you interested in how SORec works internally to produce recommendations, you can refer to chap 7 of D6.5.
|
Thx a lot @davidediruscio. I should have done that first, you are right. |
So, let's come back to my initial demand. |
Hi @phkrief we intentionally limited the results to the most 5 relevant posts. Indeed, we could add more in the results. However, let's keep the possibility of specifying the size of the results as a nice to have feature for the moment. Does it make sense? |
The number of so results can be set in the configuration file. |
@md2manoppello sure I know, but to allow end-users to change that parameter from the Eclipse IDE some more work is needed, which is in my opinion of not high priority for now. |
yes, @davidediruscio and @md2manoppello , it works for me. |
Hi,
Would it be possible to list more SOF posts?
For example, we could specify in the preference the max amount of results.
Thanks
The text was updated successfully, but these errors were encountered: