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

0 results #45

Closed
jmy48 opened this issue Mar 15, 2019 · 1 comment
Closed

0 results #45

jmy48 opened this issue Mar 15, 2019 · 1 comment

Comments

@jmy48
Copy link

jmy48 commented Mar 15, 2019

Hi, I'm just trying to do a standard concept query and I'm getting 0 results. What am I doing wrong?

`
TRAINING_STARTDATE = date(year = 2014, month = 1, day = 1)
TRAINING_ENDDATE = date(year = 2019, month = 3, day = 13)

def query(outfile, params):
q = QueryArticles(
keywords = params["keywords"],
conceptUri = "https://en.wikipedia.org/wiki/Apple_Inc.",
categoryUri = params["categories"],
sourceUri = params["sources"],
sourceLocationUri = None,
sourceGroupUri = None,
authorUri = None,
locationUri = None,
lang = "eng",
dateStart = TRAINING_ENDDATE - datetime.timedelta(days=7),
dateEnd = TRAINING_ENDDATE,
dateMentionStart = None,
dateMentionEnd = None,
keywordsLoc = "title",
ignoreKeywords = None,
ignoreConceptUri = None,
ignoreCategoryUri = None,
ignoreSourceUri = None,
ignoreSourceLocationUri = None,
ignoreSourceGroupUri = None,
ignoreAuthorUri = None,
ignoreLocationUri = None,
ignoreLang = None,
ignoreKeywordsLoc = "body",
isDuplicateFilter = "keepAll",
hasDuplicateFilter = "keepAll",
eventFilter = "keepAll",
startSourceRankPercentile = params["rankStart"], #experiment with this
endSourceRankPercentile = params["rankEnd"],
dataType = ["news", "pr", "blogs"])

r = ReturnInfo(articleInfo = ArticleInfoFlags(
    bodyLen = -1,
    title = True,
    basicInfo = True,
    body = True,
    url = True,
    eventUri = True,
    authors = True,
    concepts = True,
    categories = True,
    links = False,
    videos = False,
    image = False,
    socialScore = True,
    sentiment = True,
    location = False,
    dates = False,
    extractedDates = False,
    duplicateList = False,
    originalArticle = False,
    storyUri = False))

articles = RequestArticlesInfo(
    page = 1, 
    count = 100, 
    sortBy = "date",
    sortByAsc = False,
    returnInfo = r
    )

uris = RequestArticlesUriWgtList(
    page = 1,
    count = 50000,
    sortBy = "")

time = RequestArticlesTimeAggr()

q.setRequestedResult(articles)

results = er.execQuery(q) 
print(results)

with open(outfile, "w") as fp:
    json.dump(results, fp)

if name == "main":

query("./data/test.json", {
    "keywords": "Apple",
    "concepts": "https://en.wikipedia.org/wiki/Apple_Inc.",
    "categories": None,
    "sources": None,
    "rankStart": 0,
    "rankEnd": 100
}

`

@jmy48
Copy link
Author

jmy48 commented Mar 15, 2019

Just found out what the problem was: my uri wikpedia link has an "https://..." not an "http://.."!

@jmy48 jmy48 closed this as completed Mar 15, 2019
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

1 participant