text: (this.webpackJsonpNeuralQA=this.webpackJsonpNeuralQA||[]).push([[0],{61:function(e,t,a){e.exports=a(82)},66:function(e,t,a){},67:function(e,t,a){},68:function(e,t,a){},69:function(e,t,a){},72:function(e,t,a){},75:function(e,t,a){},76:function(e,t,a){},77:function(e,t,a){},78:function(e,t,a){},79:function(e){e.exports=JSON.parse('{"gradients":[{"gradient":0.7776244878768921,"token":"what","token_type":0},{"gradient":0.3813329041004181,"token":"is","token_type":0},{"gradient":0.4833911657333374,"token":"the","token_type":0},{"gradient":1,"token":"goal","token_type":0},{"gradient":0.4539879858493805,"token":"of","token_type":0},{"gradient":0.2254873514175415,"token":"the","token_type":0},{"gradient":0.5164986252784729,"token":"fourth","token_type":0},{"gradient":0.577403724193573,"token":"amendment","token_type":0},{"gradient":0.4014101028442383,"token":"?","token_type":0},{"gradient":0.08653245866298676,"token":"the","token_type":1},{"gradient":0.4406398832798004,"token":"fourth","token_type":1},{"gradient":0.4501516819000244,"token":"amendment","token_type":1},{"gradient":0.09730638563632965,"token":"of","token_type":1},{"gradient":0.05219580605626106,"token":"the","token_type":1},{"gradient":0.10632430016994476,"token":"u","token_type":1},{"gradient":0.08209715783596039,"token":".","token_type":1},{"gradient":0.11832378804683685,"token":"s","token_type":1},{"gradient":0.12593649327754974,"token":".","token_type":1},{"gradient":0.18220987915992737,"token":"constitution","token_type":1},{"gradient":0.2233753353357315,"token":"provides","token_type":1},{"gradient":0.09926070272922516,"token":"that","token_type":1},{"gradient":0.04957512393593788,"token":"the","token_type":1},{"gradient":0.06091616675257683,"token":"right","token_type":1},{"gradient":0.0487910620868206,"token":"of","token_type":1},{"gradient":0.03942923620343208,"token":"the","token_type":1},{"gradient":0.07061353325843811,"token":"people","token_type":1},{"gradient":0.035968974232673645,"token":"to","token_type":1},{"gradient":0.05321967601776123,"token":"be","token_type":1},{"gradient":0.08256877958774567,"token":"secure","token_type":1},{"gradient":0.06096402183175087,"token":"in","token_type":1},{"gradient":0.0372462272644043,"token":"their","token_type":1},{"gradient":0.06295276433229446,"token":"persons","token_type":1},{"gradient":0.04519972205162048,"token":",","token_type":1},{"gradient":0.06783878803253174,"token":"houses","token_type":1},{"gradient":0.040804315358400345,"token":",","token_type":1},{"gradient":0.06289402395486832,"token":"papers","token_type":1},{"gradient":0.03958067297935486,"token":",","token_type":1},{"gradient":0.05112042650580406,"token":"and","token_type":1},{"gradient":0.07284298539161682,"token":"effects","token_type":1},{"gradient":0.05123045668005943,"token":",","token_type":1},{"gradient":0.05624000355601311,"token":"against","token_type":1},{"gradient":0.1851975917816162,"token":"unreasonable","token_type":1},{"gradient":0.06078457459807396,"token":"searches","token_type":1},{"gradient":0.07405952364206314,"token":"and","token_type":1},{"gradient":0.07777296006679535,"token":"seizures","token_type":1},{"gradient":0.0655774474143982,"token":",","token_type":1},{"gradient":0.09869317710399628,"token":"shall","token_type":1},{"gradient":0.07527285069227219,"token":"not","token_type":1},{"gradient":0.0456937812268734,"token":"be","token_type":1},{"gradient":0.10462962836027145,"token":"violated","token_type":1},{"gradient":0.06425818055868149,"token":",","token_type":1},{"gradient":0.05537235736846924,"token":"and","token_type":1},{"gradient":0.0633930191397667,"token":"no","token_type":1},{"gradient":0.04549432918429375,"token":"warrants","token_type":1},{"gradient":0.0779174342751503,"token":"shall","token_type":1},{"gradient":0.047900501638650894,"token":"issue","token_type":1},{"gradient":0.05423515662550926,"token":",","token_type":1},{"gradient":0.054544754326343536,"token":"but","token_type":1},{"gradient":0.04602174833416939,"token":"upon","token_type":1},{"gradient":0.07888579368591309,"token":"probable","token_type":1},{"gradient":0.07856228202581406,"token":"cause","token_type":1},{"gradient":0.11361091583967209,"token":",","token_type":1},{"gradient":0.062142688781023026,"token":"supported","token_type":1},{"gradient":0.05307861790060997,"token":"by","token_type":1},{"gradient":0.09184946864843369,"token":"oath","token_type":1},{"gradient":0.060711491852998734,"token":"or","token_type":1},{"gradient":0.047539242853720985,"token":"affirmation","token_type":1},{"gradient":0.07517780363559723,"token":",","token_type":1},{"gradient":0.06382681429386139,"token":"and","token_type":1},{"gradient":0.10078483819961548,"token":"particularly","token_type":1},{"gradient":0.07376561313867569,"token":"describing","token_type":1},{"gradient":0.03218426927924156,"token":"the","token_type":1},{"gradient":0.04783613234758377,"token":"place","token_type":1},{"gradient":0.051581379026174545,"token":"to","token_type":1},{"gradient":0.03697739914059639,"token":"be","token_type":1},{"gradient":0.08481930196285248,"token":"searched","token_type":1},{"gradient":0.0867309644818306,"token":",","token_type":1},{"gradient":0.06060314550995827,"token":"and","token_type":1},{"gradient":0.042602699249982834,"token":"the","token_type":1},{"gradient":0.056840281933546066,"token":"persons","token_type":1},{"gradient":0.061877764761447906,"token":"or","token_type":1},{"gradient":0.04903039708733559,"token":"things","token_type":1},{"gradient":0.04995288327336311,"token":"to","token_type":1},{"gradient":0.06450371444225311,"token":"be","token_type":1},{"gradient":0.1317097693681717,"token":"seized","token_type":1},{"gradient":0.27072301506996155,"token":".","token_type":1},{"gradient":0.3593496084213257,"token":"\'","token_type":1},{"gradient":0.20046266913414001,"token":"the","token_type":1},{"gradient":0.5591774582862854,"token":"ultimate","token_type":1},{"gradient":0.6059514284133911,"token":"goal","token_type":1},{"gradient":0.22130441665649414,"token":"of","token_type":1},{"gradient":0.21139739453792572,"token":"this","token_type":1},{"gradient":0.22913874685764313,"token":"provision","token_type":1},{"gradient":0.3722269535064697,"token":"is","token_type":1},{"gradient":0.37132930755615234,"token":"to","token_type":1},{"gradient":0.3717334270477295,"token":"protect","token_type":1},{"gradient":0.16041798889636993,"token":"people","token_type":1},{"gradient":0.1518508344888687,"token":"\u2019","token_type":1},{"gradient":0.0807218924164772,"token":"s","token_type":1},{"gradient":0.15385906398296356,"token":"right","token_type":1},{"gradient":0.050815142691135406,"token":"to","token_type":1},{"gradient":0.16720698773860931,"token":"privacy","token_type":1},{"gradient":0.14042364060878754,"token":"and","token_type":1},{"gradient":0.15495635569095612,"token":"freedom","token_type":1},{"gradient":0.16938212513923645,"token":"from","token_type":1},{"gradient":0.11007372289896011,"token":"unreasonable","token_type":1},{"gradient":0.11692224815487862,"token":"intrusions","token_type":1},{"gradient":0.10463482141494751,"token":"by","token_type":1},{"gradient":0.10229557752609253,"token":"the","token_type":1},{"gradient":0.4751121699810028,"token":"government","token_type":1},{"gradient":0.480056494474411,"token":".","token_type":1},{"gradient":0.37309250235557556,"token":"however","token_type":1},{"gradient":0.2522304356098175,"token":",","token_type":1},{"gradient":0.1848718523979187,"token":"the","token_type":1},{"gradient":0.3077230453491211,"token":"fourth","token_type":1},{"gradient":0.2492513805627823,"token":"amendment","token_type":1},{"gradient":0.11481970548629761,"token":"does","token_type":1},{"gradient":0.12900979816913605,"token":"not","token_type":1},{"gradient":0.16723977029323578,"token":"guarantee","token_type":1},{"gradient":0.08052156865596771,"token":"protection","token_type":1},{"gradient":0.0599604956805706,"token":"from","token_type":1},{"gradient":0.0466151125729084,"token":"all","token_type":1},{"gradient":0.0796627625823021,"token":"searches","token_type":1},{"gradient":0.09778217226266861,"token":"and","token_type":1},{"gradient":0.13690105080604553,"token":"seizures","token_type":1},{"gradient":0.1097775250673294,"token":",","token_type":1},{"gradient":0.14515969157218933,"token":"but","token_type":1},{"gradient":0.07196320593357086,"token":"only","token_type":1},{"gradient":0.09799671918153763,"token":"those","token_type":1},{"gradient":0.05541221424937248,"token":"done","token_type":1},{"gradient":0.054436687380075455,"token":"by","token_type":1},{"gradient":0.06119629368185997,"token":"the","token_type":1},{"gradient":0.11526178568601608,"token":"government","token_type":1},{"gradient":0.07573369145393372,"token":"and","token_type":1},{"gradient":0.09001221507787704,"token":"deemed","token_type":1},{"gradient":0.0890301913022995,"token":"unreasonable","token_type":1},{"gradient":0.07160922139883041,"token":"under","token_type":1},{"gradient":0.05608946084976196,"token":"the","token_type":1},{"gradient":0.05668415129184723,"token":"law","token_type":1},{"gradient":0.13379965722560883,"token":".","token_type":1}],"answer":"to protect people \u2019 s right to privacy and freedom from unreasonable intrusions by the government","question":"what is the goal of the fourth amendment?  "}')},82:function(e,t,a){"use strict";a.r(t);var n=a(0),s=a.n(n),i=a(44),r=a.n(i),o=(a(66),a(67),a(7)),l=a(8),c=a(10),d=a(9);function m(e,t){return e.length<=t?e:e.substring(0,t)+".."}function h(e,t){return fetch(e,{method:"post",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then((function(e){return 200!==e.status?(console.log("Looks like there was a problem. Status Code: "+e.status),Promise.reject(e.status)):e.json().then((function(e){return e}))})).catch((function(e){return Promise.reject(e)}))}var p=window.LeaderLine,u={duration:800,timing:"ease"},g=a(35),k=a(3),v=a(87),f=a(88),y=a(95),b=a(93),x=a(89),E=a(92),w=a(90),N=a(91),_=a(86),S=a(94),A=(a(68),a(6)),C=(a(69),function(e){Object(c.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(o.a)(this,a),(n=t.call(this,e)).createSVGBox=function(e,t){return A.g(e).append("svg").attr("width",n.chartWidth+n.chartMargin.left+n.chartMargin.right).attr("height",t+n.chartMargin.top+n.chartMargin.bottom).append("g").attr("transform","translate("+n.chartMargin.left+","+n.chartMargin.top+")")},n.createBarRects=function(e,t,a,s,i,r){e.append("g").attr("class",i).selectAll("rect").data(s).join("rect").attr("x",(function(e,a){return t(n.getLabel(e,a))})).attr("y",(function(e){return a(e.gradient)})).attr("height",(function(e){return a(0)-a(e.gradient)})).attr("width",t.bandwidth()).attr("class",r?"strokedbarrect":"").attr("fill",(function(e){return"rgba(0, 98, 255, "+(r?e.gradient:1)+")"}))},n.grads=e.data.gradients,n.minChartHeight=250,n.minChartWidth=n.props.minChartWidth||800,n.brushHeight=60,n.barColor="#0062ff",n.inactiveColor="rgba(85, 85, 85, 0.586)",n.initialBrushPercentage=35/n.grads.length,n}return Object(l.a)(a,[{key:"getLabel",value:function(e,t){return t+"*.*"+e.token+" *.* ("+e.gradient.toFixed(2)+")"}},{key:"componentWillUnmount",value:function(){}},{key:"componentDidUpdate",value:function(e,t){}},{key:"setupScalesAxes",value:function(e){var t=this;this.chartMargin={top:5,right:0,bottom:0,left:0},this.chartWidth=this.minChartWidth-this.chartMargin.left-this.chartMargin.right,this.chartHeight=this.minChartHeight-this.chartMargin.top-this.chartMargin.bottom,this.xScale=A.e().domain(e.map((function(e,a){return t.getLabel(e,a)}))).range([this.chartMargin.left,this.chartWidth-this.chartMargin.right]),this.yScale=A.f().domain([0,A.c(e,(function(e){return e.gradient}))]).nice().range([this.chartHeight,0])}},{key:"drawBrushGraph",value:function(e){var t=this;this.brushXScale=this.xScale.copy(),this.brushYScale=this.yScale.copy().range([this.brushHeight,0]);var a=this.brushXScale,n=this.brushYScale,s=A.f().range([this.chartMargin.left,this.chartWidth-this.chartMargin.right]).domain([this.chartMargin.left,this.chartWidth-this.chartMargin.right]),i=this.createSVGBox("div.d3brush",this.brushHeight);this.createBarRects(i,a,n,e,"minibars",!1);var r=A.a().extent([[this.chartMargin.left,.5],[this.chartWidth-this.chartMargin.right,this.brushHeight]]).on("brush",(function(){var e=A.b.selection,n=a.domain().filter((function(t){return e[0]-a.bandwidth()+.01<=a(t)&&a(t)<=e[1]-.01}));A.g("div.d3brush").select(".minibars").selectAll("rect").style("fill",(function(e,a){return n.indexOf(t.getLabel(e,a))>-1?t.barColor:t.inactiveColor})),l(e),function(e){var a=t.xScale,n=t.yScale;A.g("div.barviz").selectAll("rect.mainbars").data(e).join("rect").attr("x",(function(e,n){return a(t.getLabel(e,n))})).attr("y",(function(e){return n(e.gradient)})).attr("height",(function(e){return n(0)-n(e.gradient)})).attr("width",a.bandwidth())}(t.grads)})).on("start",(function(){A.g("div.barviz").selectAll("text.textlabel").attr("class","textinvisible textlabel")})).on("end",(function(){A.g("div.barviz").selectAll("text.textlabel").attr("class","textlabel");var a=A.b.selection;if(a){l(a),A.g("div.barviz").selectAll("text.textlabel").data(e).attr("x",(function(e,a){return t.xScale(t.getLabel(e,a))+t.xScale.bandwidth()/2})).attr("y",(function(e){return t.yScale.range()[0]}))}})),o=[a.range()[0],(a.range()[1]-a.range()[0])*t.initialBrushPercentage];function l(a){var n=s.range();s.domain(a),t.xScale.domain(e.map((function(e,a){return t.getLabel(e,a)}))),t.xScale.range([s(n[0]),s(n[1])]).paddingInner(.1)}i.append("g").call(r).call(r.move,o)}},{key:"createToolTip",value:function(e){var t=e.append("g").attr("class","tooltiptext").style("display","none");return t.append("rect").attr("class","tooltiprect"),t.append("text").attr("x",10).attr("dy","1.2em"),t}},{key:"drawGraph",value:function(e){var t=this;this.setupScalesAxes(e);var a=this.xScale,n=this.yScale,s=this.createSVGBox("div.barviz",this.chartHeight),i=s.selectAll("g").data(e).join("g");i.append("rect").attr("class","strokedbarrect mainbars").attr("fill",(function(e){return"rgba(0, 98, 255, "+(e.gradient>.5?1:.5+.5*e.gradient)+")"})).attr("width",a.bandwidth()).attr("height",(function(e){return n(0)-n(e.gradient)})).on("mouseover",(function(){r.style("display",null),A.g(this).attr("fill","lightgrey")})).on("mouseout",(function(e){r.style("display","none"),A.g(this).attr("fill","rgba(0, 98, 255, "+(e.gradient>.5?1:.5+.5*e.gradient)+")")})).on("mousemove",(function(e){var t=A.d(this)[0]+10,a=A.d(this)[1]-20;r.attr("transform","translate("+t+","+a+")"),r.select("text").text(e.token),r.select("rect").attr("width",r.select("text").node().getComputedTextLength()+20)})),i.append("text").attr("x",(function(e,n){return a(t.getLabel(e,n))})).attr("y",(function(e){return n(e.gradient)})).attr("class","textlabel").text((function(e){return e.token}));var r=this.createToolTip(s)}},{key:"componentDidMount",value:function(){document.getElementById("barviz").style.width=this.minChartWidth+"px",this.drawGraph(this.grads),this.drawBrushGraph(this.grads)}},{key:"render",value:function(){return s.a.createElement("div",{className:" barvizcontent "},s.a.createElement("div",{className:" "},s.a.createElement("div",{id:"barviz",className:"barviz "}),s.a.createElement("div",{id:"d3brush",className:"d3brush  "})))}}]),a}(n.Component)),I=function(e){Object(c.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(o.a)(this,a),(n=t.call(this,e)).state={minCharWidth:null},n}return Object(l.a)(a,[{key:"getLabel",value:function(e,t){return t+"*.*"+e.token+" *.* ("+e.gradient.toFixed(2)+")"}},{key:"componentDidUpdate",value:function(e,t){}},{key:"componentDidMount",value:function(){this.setState({minCharWidth:document.getElementById("barvizcontainer").offsetWidth-40})}},{key:"render",value:function(){var e=this.props.data.gradients.map((function(e,t){return s.a.createElement("span",{style:{backgroundColor:"rgba(0, 98, 255, "+e.gradient+")"},className:"explanationspan ",key:"expspan"+t},e.token," \xa0")}));return s.a.createElement("div",{className:"expview "},s.a.createElement(_.a,{id:"barvizcontainer",type:"default",selected:0},s.a.createElement(S.a,{id:"tab-2",label:"Density"},s.a.createElement("div",{className:"viztabcontent p10"},s.a.createElement("div",{className:"smalldesc mb10"},"* Darker words indicate larger impact on answer span selection."),s.a.createElement("div",{className:"some-content "},s.a.createElement("div",{className:"mediumdesc lhmedium"},e)))),s.a.createElement(S.a,{id:"tab-2",label:"Bar"},s.a.createElement("div",{className:"viztabcontent p10"},s.a.createElement("div",{className:"smalldesc mb10"},"* Darker bars indicate larger impact on answer span selection."),this.state.minCharWidth&&s.a.createElement(C,{minChartWidth:this.state.minCharWidth,data:this.props.data})))),s.a.createElement("div",{className:"pt5 smalldesc lhmedium"},"The visualizations above indicate how each word in the query and context contributes to the model's selection of an answer span."))}}]),a}(n.Component),L=a(47),O=(a(72),function(e){Object(c.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(o.a)(this,a),(n=t.call(this,e)).data=e.data,n.state={data:n.data,showInfoModal:!1},n.blueColor="#0062ff",n.greyColor="#c4c3c3",n}return Object(l.a)(a,[{key:"componentDidUpdate",value:function(e,t){this.props.data!==e.data&&(this.removeAllLines(),this.drawLines()),this.props.viewChanged!==e.viewChanged&&this.redrawAllLines()}},{key:"clickTerm",value:function(e){this.props.addQueryTerm(e.target.innerHTML)}},{key:"updateGraph",value:function(e){}},{key:"drawLeaderLine",value:function(e,t,a,n){var s=this.blueColor,i=new p(p.pointAnchor(e,a),p.pointAnchor(t,n),{color:s,startPlug:"square",endPlug:"arrow2",startPlugColor:s,endSocketGravity:400,path:"arc",size:1.5,hide:!0});u.duration=this.state.animationDuration,i.show("draw",u),this.lineHolder.push({line:i})}},{key:"removeAllLines",value:function(e){this.lineHolder.forEach((function(e){e.line.remove()})),this.lineHolder=[]}},{key:"redrawAllLines",value:function(){this.lineHolder.forEach((function(e){e.line.position()}))}},{key:"getElement",value:function(e,t){return document.querySelector("div").querySelector("["+e+"="+t+"]")}},{key:"componentDidMount",value:function(){this.lineHolder=[],this.topAnchor={x:"50%",y:0},this.bottomAnchor={x:"50%",y:"100%"},this.leftAnchor={x:"0%",y:"50%"},this.rightAnchor={x:"100%",y:"50%"},this.drawLines()}},{key:"drawLines",value:function(){var e,t=Object(L.a)(this.props.data.expansions);try{for(t.s();!(e=t.n()).done;){var a=e.value;if(a.expansion)for(var n=0;n<a.expansion.length;n++){var s="term"+a.token_index,i="subterm"+a.token_index+n,r=this.getElement("id",s),o=this.getElement("id",i);this.drawLeaderLine(r,o,this.leftAnchor,this.leftAnchor)}}}catch(l){t.e(l)}finally{t.f()}}},{key:"componentWillUnmount",value:function(){this.removeAllLines()}},{key:"clickInfo",value:function(e){this.setState({showInfoModal:!this.state.showInfoModal})}},{key:"render",value:function(){var e=this,t=[],a=this.props.data;a.expansions&&a.terms&&(t=a.terms.map((function(e,t){return s.a.createElement("div",{key:"expansionterm"+t,className:"smalldesc unclickable iblock mr5"},e.token)})));var n=a.expansions.map((function(t,a){var n=(t.expansion||[]).map((function(a,n){return s.a.createElement("div",{key:"subterms"+n,id:"subterm"+t.token_index+n,className:"ml10  h100 p5 subtermbox clickable",onClick:e.clickTerm.bind(e)},a.token)})),i=n.length>0?e.blueColor:e.greyColor;return s.a.createElement("div",{key:"termrow"+a,className:"iblock h100 termcontainer "},s.a.createElement("div",{className:"smalldesc lhsmall underline pb3"},s.a.createElement("div",{className:"tooltip iblock mr5"},t.pos,s.a.createElement("span",{className:"expandtooltiptext"},s.a.createElement("div",{className:"underline boldtext pb3 mb5"},"PART\xa0OF\xa0SPEECH"),s.a.createElement("div",null," ",(t.pos_desc||"").toUpperCase()))),s.a.createElement("div",{className:"tooltip iblock"},""!==t.named_entity?"| "+t.named_entity:"",s.a.createElement("span",{className:"expandtooltiptext "},s.a.createElement("div",{className:"underline boldtext  pb3 mb5"},"NAMED\xa0ENTITY"),s.a.createElement("div",null," ",(t.ent_desc||"").toUpperCase())))),s.a.createElement("div",{id:"term"+a,className:"termbox mt10 unclickable "+(n.length>0?"mb5":""),style:{color:n.length>0?"white":"",backgroundColor:i}},t.token),s.a.createElement("div",{className:""},n))}));return s.a.createElement("div",{className:" "},s.a.createElement(b.a,{open:this.state.showInfoModal,modalHeading:"How does Query Expansion Work?",passiveModal:!0,size:"lg","aria-label":"Query expansion info modal",modalAriaLabel:"Query expansion info modal",onRequestClose:this.clickInfo.bind(this),hasScrollingContent:!0},s.a.createElement("div",null,s.a.createElement("div",{className:"underline boldmediumtext pb5 mb10"}," ","What is Contextual Query Expansion?"," "),"Query expansion works as follows. First, a set of rules are used to determine which token in the query to expand. These rules are chosen to improve recall (surface relevant queries) without altering the semantics of the original query. Example rules include only expanding ADJECTIVES AND ADVERBS ; other parts of speech such as nouns, proper nouns or even named entities are not expanded. Once expansion candidates are selected, they are then iteratively masked and a masked language model is used to predict tokens that best complete the sentence given the surrounding tokens. Additional details are provided in the"," ",s.a.createElement("a",{target:"_blank",href:"https://arxiv.org/abs/2007.15211"}," ","NeuralQA paper.")," ",s.a.createElement("div",{className:"underline boldmediumtext mt10 pb5 mb10"}," ","How is this Implemented?"," "),"Part of speech detection is implemented using Spacy NLP. A BERT based masked language model is used for predicting expansion terms (can be selected under advanced options).",s.a.createElement("br",null)," ",s.a.createElement("br",null),"*Note contextual query expansion works best when the model is trained on the target (open-domain) dataset.")),s.a.createElement("div",{className:" mb10"},s.a.createElement("span",{className:"boldtext"}," ",t.length," Suggested Expansion Terms"," "),s.a.createElement("span",{className:"mediumdesc"}," ",this.props.data.took.toFixed(3)," seconds"),"."),s.a.createElement("div",{className:" expandview"},s.a.createElement("div",{className:"  positionrelative pb5 mediumdesc"},s.a.createElement("div",{className:"pt10 pb10 underline"},"Click any of the expansion candidate terms below to append it to your query"),s.a.createElement("div",{className:"whatsthis clickable",onClick:this.clickInfo.bind(this)},s.a.createElement("span",{className:"infocircle"}," ?")," info")),s.a.createElement("div",{className:""},n),s.a.createElement("div",{className:"smalldesc pt5 lhsmall "}," ","The visualization above indicates how the expansion terms were generated.",s.a.createElement("br",null))))}}]),a}(n.Component)),T=(a(75),function(e){Object(c.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(o.a)(this,a),(n=t.call(this,e)).options=e.data.options,n.state={apptitle:e.data.intro.title,appsubtitle:e.data.intro.subtitle,passages:{took:0,highlights:null},answers:{took:0,answers:null},passageIsLoading:!1,answerIsLoading:!1,errorStatus:"",maxdocuments:n.options.maxdocuments.selected,reader:n.options.reader.selected,fragmentsize:n.options.fragmentsize.selected,chunkStride:n.options.stride.selected,retriever:n.options.retriever.selected,expander:n.options.expander.selected,relsnip:n.options.relsnip.selected,sampleQA:n.options.samples,selectedExplanation:0,selectedSampleIndex:0,explanations:{},showAdvancedView:!1,showExplanationsView:e.data.views.explanations,showPassagesView:e.data.views.passages,showExpander:!0,expansions:null,expansionterms:new Set([]),openAdvancedConfigDrawer:!0,showSamples:e.data.views.samples,showAllAnswers:e.data.views.allanswers,showIntro:e.data.views.intro,showInfoModal:!1,showExplainerModal:!1},n.serverBasePath=e.serverBasePath,n.passageEndpoint="/api/documents",n.answerEndpoint="/api/answers",n.explainEndpoint="/api/explain",n.expandEndpoint="/api/expand",n.interfaceTimedDelay=400,n.maxStatusElasped=6,n.documentTitleLength=150,n.advancedOptionsDescriptions=[{title:"Retriever",value:"retriever",description:"A list of search indexes that will be used to retrieve documents that match the search query. If set to None, the interface will let you provide a document/passage in addition to your question"},{title:"Reader",value:"reader",description:"A Question Answering model that will take in your question and retrieved documents (or provided passsage) and extract an answer to the question if it exists in the document."},{title:"Token Stride",value:"chunkStride",description:"Token stride specifies the overlap between document chunks. QA reader models have limitations on the maximum size of text tokens they can process in a single pass. Lengthy documents are typically broken down in to smaller document chunks and iteratively processed by the model. "},{title:"Max Documents",value:"maxdocuments",description:"Number of documents to return for a retriever query."},{title:"Expander",value:"expander",description:"Contextual Query Expansion (see <a target='_blank' href='https://arxiv.org/abs/2007.15211' > https://arxiv.org/abs/2007.15211</a>) for identifying additional query terms that can improve recall."},{title:"RelSnip",value:"relsnip",description:"Relevant Snippets (RelSnip) is a method for constructing smaller documents from lengthy documents and is implemented as follows. For each retrieved document, we apply a highlighter (Lucene Unified Highlighter) which breaks the document into fragments and uses the BM25 algorithm to score each fragment as if they were individual documents in the corpus. Next, we concatenate the top n (default 5) fragments as a new document which is then processed by the reader. When Relsnip is set to false, the reader reads the entire document by breaking it into chunks. To maintain decent user experience, we process a maximum of 5 chunks."},{title:"Fragment Size",value:"fragmentsize",description:"The size (number of characters) of each highlight fragment."}],n}return Object(l.a)(a,[{key:"componentDidMount",value:function(){this.askQuestion()}},{key:"resetAnswer",value:function(){this.setState({passages:{took:0,highlights:null},answers:{took:0,answers:null},errorStatus:"",explanations:{},expansions:null,expansionterms:new Set([])})}},{key:"resetExplanations",value:function(){this.setState({explanations:{}})}},{key:"askQuestion",value:function(){this.resetExplanations();var e=document.getElementById("queryinput").value,t=document.getElementById("contextinput")?document.getElementById("contextinput").value:null,a={max_documents:this.state.maxdocuments,context:t||this.state.sampleQA[0].context,query:e||this.state.sampleQA[0].question,fragment_size:this.state.fragmentsize,reader:this.state.reader,retriever:this.state.retriever,tokenstride:this.state.chunkStride,relsnip:this.state.relsnip,expansionterms:Array.from(this.state.expansionterms)};"none"!==this.state.retriever&&this.getPassages(a),this.getAnswers(a),this.lastAsked=new Date}},{key:"getAnswers",value:function(e){var t=this,a=this;this.setState({answerIsLoading:!0}),h(this.serverBasePath+this.answerEndpoint,e).then((function(e){e&&(t.setState({answers:e,errorStatus:"",expansions:null}),setTimeout((function(){t.setState({answerIsLoading:!1})}),t.interfaceTimedDelay))})).catch((function(e){console.log("Failed to fetch answers",e),a.setState({answerIsLoading:!1,errorStatus:"Reader failed to fetch answer. Reader server may need to be restarted. Error msg : "+e})}))}},{key:"getPassages",value:function(e){var t=this,a=this;this.setState({passageIsLoading:!0}),h(this.serverBasePath+this.passageEndpoint,e).then((function(e){e.status&&t.setState({passages:e});var a=e.status?"":"Error Fetching Passages. \n"+e.errormsg;setTimeout((function(){t.setState({passageIsLoading:!1,errorStatus:a})}),t.interfaceTimedDelay)})).catch((function(e){console.log("Fetch Error :-S",e),a.setState({passageIsLoading:!1,errorStatus:"Retriever to fetch documents. Retriever server may need to be restarted."})}))}},{key:"askQuestionButtonClick",value:function(e){this.askQuestion()}},{key:"inputKeyPress",value:function(e){13===e.keyCode&&this.askQuestion()}},{key:"toggleSearchConfig",value:function(e){this.setState({openAdvancedConfigDrawer:!this.state.openAdvancedConfigDrawer})}},{key:"clickInfo",value:function(e){this.setState({showInfoModal:!this.state.showInfoModal})}},{key:"clickSampleQuestion",value:function(e){var t=this;this.setState({passages:{took:0,highlights:[]},answers:{took:0,answers:[]},selectedSampleIndex:e.target.getAttribute("qindex")},(function(){t.askQuestion()}))}},{key:"getExplanation",value:function(e){var t=this,a=this,n=(this.state.answers.answers||[])[e],s={query:n.question,context:n.context};this.setState({answerIsLoading:!0}),h(this.serverBasePath+this.explainEndpoint,s).then((function(a){if(a){var n=t.state.explanations;n[e]=a,t.setState({explanations:n}),setTimeout((function(){t.setState({answerIsLoading:!1})}),t.interfaceTimedDelay)}})).catch((function(e){console.log("Fetch Error :-S",e),a.setState({answerIsLoading:!1,errorStatus:"Failed to fetch explainations. Explaination server may need to be restarted."})}))}},{key:"getExpansion",value:function(){var e=this,t={query:document.getElementById("queryinput").value,expander:this.state.expander};h(this.serverBasePath+this.expandEndpoint,t).then((function(t){t&&e.setState({expansions:t})})).catch((function(e){console.log("Fetch Error :-S",e)}))}},{key:"closeExplainerModal",value:function(){this.setState({showExplainerModal:!1})}},{key:"clickExplainButton",value:function(e){var t=e.target.getAttribute("id");this.getExplanation(t),this.setState({showExplainerModal:!0,selectedExplanation:t})}},{key:"expandButtonClick",value:function(e){this.setState({expansionterms:new Set([])}),this.getExpansion()}},{key:"updateConfigSelectParams",value:function(e){var t=e.target.options[e.target.selectedIndex].getAttribute("type"),a=e.target.options[e.target.selectedIndex].value;switch(t){case"maxdocuments":this.setState({maxdocuments:a});break;case"reader":this.setState({reader:a});break;case"stride":this.setState({chunkStride:a});break;case"fragmentsize":this.setState({fragmentsize:a});break;case"retriever":this.setState({retriever:a});break;case"relsnip":this.setState({relsnip:a});break;case"expander":this.setState({expander:a})}this.resetAnswer()}},{key:"getOptionItems",value:function(e,t){var a=this.options[e].options.map((function(t,a){return s.a.createElement(v.a,{key:"select"+e+a,value:t.value,text:t.name+"",type:e})}));return s.a.createElement(f.a,{id:e+"select",defaultValue:this.options[e].selected,hideLabel:!0,style:{width:"100%"},onChange:this.updateConfigSelectParams.bind(this)},a)}},{key:"toggleAdvancedOptions",value:function(e){this.setState({showAdvancedView:!this.state.showAdvancedView})}},{key:"addQueryTerm",value:function(e){var t=document.getElementById("exptermslistbox"),a=this.state.expansionterms;t&&!a.has(e)&&(t.style.opacity="0",setTimeout((function(){t.value=t.value+" "+e,t.style.opacity="1"}),400)),a.add(e),this.setState({expansionterms:a})}},{key:"removeTermClick",value:function(e){var t=this.state.expansionterms;t.delete(e.target.getAttribute("termvalue")),this.setState({expansionterms:t})}},{key:"componentDidUpdate",value:function(e,t,a){}},{key:"render",value:function(){var e=this,t=this.state.answers.answers||[],a=this.state.passageIsLoading||this.state.answerIsLoading,n=this.advancedOptionsDescriptions.map((function(t,a){return s.a.createElement("div",{className:"infodescrow underline pb10 pt5",key:"infodesc"+a},s.a.createElement("div",{className:" infodesctitle"},s.a.createElement("span",{className:"boldtext"}," ",t.title)," ",e.state[t.value]+""),s.a.createElement("div",{className:" infodescdesc",dangerouslySetInnerHTML:{__html:t.description}}))})),i=this.state.passages.highlights||[],r=i.map((function(t,a){var n=t.substring(0,e.documentTitleLength);return s.a.createElement("div",{className:"passagerow flex",key:"passagerow"+a},s.a.createElement("div",{className:"answerrowtitletag mr10"}," D",a," "),s.a.createElement("div",{className:"flexfull"},s.a.createElement("div",{className:"passagetitle highlightsection mb10   underline lhmedium",dangerouslySetInnerHTML:{__html:n}}),s.a.createElement("span",{className:"highlightsection iblock lhmedium  ",dangerouslySetInnerHTML:{__html:"<span class='excerpttitle mediumdesc'> All highlights: </span> <span class='lhmedium mediumdesc'>"+t+"</span>"}})))})),o=t.slice(0,this.state.showAllAnswers?t.length:1).map((function(t,a){return s.a.createElement("div",{className:"flex  p10 answerrow "+(0===a?"topanswer":""),key:"answerrow"+a},s.a.createElement("div",{className:"answerrowtitletag mr10"}," A",t.index," "),s.a.createElement("div",{className:"flexfull"},s.a.createElement("div",null,s.a.createElement("div",{className:"smalldesc pt5"},"Time: ",t.took.toFixed(3),"s |"," ",(1*t.probability).toFixed(4)),s.a.createElement("div",{className:"boldtext pt5"}," ",s.a.createElement("span",{className:"answerquote"},"\u201c")," ",t.answer," ",s.a.createElement("span",{className:"pt10 answerquote"},"\u201d")," "),s.a.createElement("div",null,s.a.createElement("div",{className:"p10 mt10 mb10  mediumdesc lhmedium contextrow lightgreyhighlight",dangerouslySetInnerHTML:{__html:t.context}}),e.state.explanations[a]&&s.a.createElement(I,{data:e.state.explanations[a]}),e.state.showExplanationsView&&!e.state.explanations[a]&&s.a.createElement(y.a,{id:a,onClick:e.clickExplainButton.bind(e),size:"small"},"Explain")))))})),l=this.state.sampleQA.map((function(t,a){return s.a.createElement("div",{qindex:a,onClick:e.clickSampleQuestion.bind(e),key:"qasample"+a,className:"samplequestionrow mediumdesc clickable iblock "+(e.state.selectedSampleIndex+""===a+""?" selected ":" ")},t.question)})),c=(new Date-this.lastAsked)/1e3>this.maxStatusElasped,d=s.a.createElement("div",{ref:"modelconfigbar",style:{zIndex:100},className:"w100 pl10  pb10 unselectable greyhighlight modelconfigbar"},s.a.createElement("div",{className:"positionrelative  "},s.a.createElement("div",{className:" pt10 pb10 underline"},"Select QA model configuration."),s.a.createElement("div",{className:"whatsthis clickable",onClick:this.clickInfo.bind(this)},s.a.createElement("span",{className:"infocircle"}," ?")," info")),s.a.createElement("div",{className:"w100   displayblock  "},s.a.createElement("div",{className:"  iblock mr10"},s.a.createElement("div",{className:"mediumdesc pb7 pt5"}," ",this.options.retriever.title," ",s.a.createElement("span",{className:"boldtext"}," ",this.state.retriever," ")," "),this.getOptionItems("retriever","")),s.a.createElement("div",{className:"pl10 borderleftdash iblock mr10"},s.a.createElement("div",{className:"mediumdesc pb7 pt5"}," ",this.options.reader.title," ",s.a.createElement("span",{className:"boldtext"}," ",m(this.state.reader,16)," ")," "),this.getOptionItems("reader","")),s.a.createElement("div",{className:"iblock mr10"},s.a.createElement("div",{className:"mediumdesc pb7 pt5"}," ",this.options.stride.title,s.a.createElement("span",{className:"boldtext"}," ",this.state.chunkStride," ")," "),this.getOptionItems("stride","")),"none"!==this.state.retriever&&s.a.createElement("div",{className:"pl10 borderleftdash iblock mr10 "},s.a.createElement("div",{className:"mediumdesc pb7 pt5"}," ",this.options.maxdocuments.title," ",s.a.createElement("span",{className:"boldtext"}," ",this.state.maxdocuments," ")," "),this.getOptionItems("maxdocuments","")),this.state.showExpander&&s.a.createElement("div",{className:" iblock mr10"},s.a.createElement("div",{className:"mediumdesc pb7 pt5"}," ",this.options.expander.title," ",s.a.createElement("span",{className:"boldtext"}," ",m(this.state.expander+"",16)," ")," "),this.getOptionItems("expander","")),"none"!==this.state.retriever&&s.a.createElement("div",{className:"iblock mr10 "},s.a.createElement("div",{className:"mediumdesc pb7 pt5"}," ",this.options.fragmentsize.title," ",s.a.createElement("span",{className:"boldtext"}," ",this.state.fragmentsize," ")," "),this.getOptionItems("fragmentsize","")),"none"!==this.state.retriever&&s.a.createElement("div",{className:" iblock mr10"},s.a.createElement("div",{className:"mediumdesc pb7 pt5"}," ",this.options.relsnip.title," ",s.a.createElement("span",{className:"boldtext"}," ",m(this.state.relsnip+"",16)," ")," "),this.getOptionItems("relsnip","")))),h=Array.from(this.state.expansionterms).map((function(t,a){return s.a.createElement("div",{key:"expterms"+a,className:"exptermbox iblock mr5"},s.a.createElement("div",{className:"iblock exptermboxdata unclickable"},t),s.a.createElement("div",{onClick:e.removeTermClick.bind(e),termvalue:t,className:"iblock termboxclose"},"x"))}));return s.a.createElement("div",null,s.a.createElement(b.a,{open:this.state.showInfoModal,modalHeading:"Description of advanced options",passiveModal:!0,size:"lg","aria-label":"Info Modal",modalAriaLabel:"Info Modal",onRequestClose:this.clickInfo.bind(this),hasScrollingContent:!0},n),this.state.showIntro&&s.a.createElement("div",{className:"clearfix mynotif positionrelative  mt10 h100 lh10  lightbluehightlight maxh16  mb10"},this.props.data.views.advanced&&s.a.createElement("div",{className:" floatright lightgreyhighlight ml10  pr10 pl10 pb10 "},s.a.createElement("div",{className:"boldtext  iblock "},s.a.createElement(x.a,{id:"advancedoptionstoggle",className:"smalldesc boldtext mr10",labelA:"Off",labelB:"On",defaultToggled:this.state.showAdvancedView,onToggle:this.toggleAdvancedOptions.bind(this)})),s.a.createElement("div",{className:"mediumdesc boldtext"}," Advanced Options")),s.a.createElement("span",{className:"boldtext mb5"},this.state.apptitle),s.a.createElement("br",null),this.state.appsubtitle),s.a.createElement("div",{className:" mb10"+(this.state.showAdvancedView?"":" displaynone")},s.a.createElement("div",{onClick:this.toggleSearchConfig.bind(this),className:"unselectable mt10 p10 clickable  flex greymoreinfo"},s.a.createElement("div",{className:"iblock flexfull minwidth485"},s.a.createElement("strong",null," ",!this.state.openAdvancedConfigDrawer&&s.a.createElement("span",null,"\u25bc ")," ",this.state.openAdvancedConfigDrawer&&s.a.createElement("span",null,"\u25b2 ")," "),"Advanced Options"),s.a.createElement("div",{className:"iblock   "},s.a.createElement("div",{className:"iblock mr5"}," ",s.a.createElement("span",{className:"boldtext"}," ")),s.a.createElement("div",{className:"iblock"},s.a.createElement("div",{className:"smalldesc"}," ",this.state.maxdocuments," Results |"," ",this.state.reader.toUpperCase()," ")))),s.a.createElement("div",{className:"flex underline p10 modelconfigdiv w100  "+(this.state.openAdvancedConfigDrawer?"":" displaynone")},s.a.createElement("div",{className:"w100"}," ",d))),"none"===this.state.retriever&&this.state.showSamples&&s.a.createElement("div",{className:" mb10"},s.a.createElement("div",{className:"smalldesc p5"}," ","Select any sample question/passage pair below"," "),l),s.a.createElement("div",{className:"mt5 mt10 mb10 mediumdesc"}," Enter question "),s.a.createElement("div",{className:"flex flexwrap searchbar"},s.a.createElement("div",{key:"queryinput"+this.state.selectedSampleIndex,className:"flex80 flexwrapitem"},s.a.createElement(E.a,{id:"queryinput",defaultValue:this.state.sampleQA[this.state.selectedSampleIndex].question,hideLabel:!0,labelText:"Hi there",onKeyDown:this.inputKeyPress.bind(this),className:"",placeholder:"Enter question. e.g. Which cases cite dwayne vs the united states."})),s.a.createElement("div",{className:"flexwrapitem  "}," ","none"!==this.state.expander&&s.a.createElement(y.a,{className:"mr2 flex80",onClick:this.expandButtonClick.bind(this),size:"field"}," ","Expand Query?"),s.a.createElement(y.a,{onClick:this.askQuestionButtonClick.bind(this),size:"field"}," ","Get Answer"," "))),this.state.expansionterms.size>0&&s.a.createElement("div",{id:"exptermslistbox",className:"mt5 transitiono3s"},s.a.createElement("span",{className:"boldtext selectedtermslabel unclickable"}," ","expansion terms:"," "),h),this.state.expansions&&this.state.expansions.terms&&s.a.createElement("div",{className:" pt10"},s.a.createElement(O,{data:this.state.expansions,viewChanged:this.state.openAdvancedConfigDrawer+""+this.state.showAdvancedView+this.state.expansionterms.size,addQueryTerm:this.addQueryTerm.bind(this)})),"none"===this.state.retriever&&s.a.createElement("div",{key:"contexttextarea"+this.state.selectedSampleIndex,className:"mt10"},s.a.createElement("div",{className:"mt5 mb10 mediumdesc"}," Enter passage "),s.a.createElement(w.a,{id:"contextinput",className:"contextinputarea",defaultValue:this.state.sampleQA[this.state.selectedSampleIndex].context,labelText:"Enter a passage",hideLabel:!0})),s.a.createElement("div",{className:"mediumdesc pt7 pb7"},this.state.answerIsLoading&&s.a.createElement("span",null," Asking BERT for answers ... ")),!c&&this.state.errorStatus.length>1&&s.a.createElement("div",{className:"errormessage"},this.state.errorStatus),o.length>0&&s.a.createElement("div",null,s.a.createElement("div",{className:"flex mt10 "},s.a.createElement("div",{className:"loaderbox",style:{opacity:a?1:0,width:a?"34px":"0px"}},s.a.createElement(N.a,{className:" ",active:!0,small:!0,withOverlay:!1}," ")),s.a.createElement("div",{className:"flexfull  sectionheading"},s.a.createElement("span",{className:"boldtext"}," ",o.length," Answer",o.length>1?"s":""," ","returned"," "),!this.state.answerIsLoading&&s.a.createElement("span",{className:"mediumdesc"}," ",this.state.answers.took.toFixed(3)," seconds."," ")),s.a.createElement("div",{className:"lh2m"},this.state.answerIsLoading&&s.a.createElement("span",{className:"mediumdesc"}," Loading answers ... "))),s.a.createElement("div",null,o)),this.state.answers.answers&&0===this.state.answers.answers.length&&!this.state.answerIsLoading&&s.a.createElement("div",{className:"p10 orangehighlight"},"No answers found."),(this.state.showPassagesView&&r.length)>0&&s.a.createElement("div",null,s.a.createElement("div",{className:"mt10 mb10"},s.a.createElement("span",{className:"boldtext"}," ",i.length," Documents returned."," "),this.state.passageIsLoading&&s.a.createElement("span",{className:"mediumdesc"}," Loading passages ... "),!this.state.passageIsLoading&&s.a.createElement("span",{className:"mediumdesc"}," ",this.state.passages.took/1e3," seconds"," ")),s.a.createElement("div",{className:"passagebox  mt10"},r)),!c&&this.state.passages.highlights&&0===this.state.passages.highlights.length&&"none"!==this.state.retriever&&!this.state.passageIsLoading&&s.a.createElement("div",{className:"p10 mt5 orangehighlight"},"Your query did not match any passages. Try a different query."),s.a.createElement("br",null),s.a.createElement("br",null),s.a.createElement("br",null))}}]),a}(n.Component)),D=(a(76),function(e){Object(c.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(o.a)(this,a),(n=t.call(this,e)).appName=e.data.appname||"NeuralQA",n.appDescription=e.data.appdescription||" Question Answering on Large Datasets.",n}return Object(l.a)(a,[{key:"render",value:function(){return s.a.createElement("div",null,s.a.createElement("div",{className:"headermain","aria-label":this.appDescription},s.a.createElement("div",{className:"container-fluid w100 headerrow pl10 "},s.a.createElement("div",{className:"flex    h100"},s.a.createElement("div",{className:"h100   flex flexjustifycenter mr10  "},s.a.createElement("a",{href:"/#"},s.a.createElement("img",{className:"headericon",src:"images/icon.png",alt:"NeuralQA logo"}))),s.a.createElement("div",{className:"h100 apptitle  flex flexjustifycenter  mr10"},s.a.createElement("div",{className:"whitetext boldtext  iblock mr10"},"  ",this.appName," "))))),s.a.createElement("div",null),s.a.createElement("div",{className:"headerboost"},"  "))}}]),a}(n.Component)),q=(a(77),function(e){Object(c.a)(a,e);var t=Object(d.a)(a);function a(){return Object(o.a)(this,a),t.apply(this,arguments)}return Object(l.a)(a,[{key:"render",value:function(){return s.a.createElement("div",{style:{zIndex:999e3},className:"centerpage pl10"},"\xa9 NeuralQA 2020. Learn more on ",s.a.createElement("a",{href:"https://github.com/victordibia/neuralqa",target:"blank"},"Github"),".")}}]),a}(n.Component)),M=a(11),z=(a(78),function(e){Object(c.a)(n,e);var t=Object(d.a)(n);function n(e){var s;return Object(o.a)(this,n),(s=t.call(this,e)).data=a(79),s}return Object(l.a)(n,[{key:"componentDidMount",value:function(){this.barVizWidth=document.getElementById("barvizcontainer").offsetWidth}},{key:"render",value:function(){return s.a.createElement("div",{id:"barvizcontainer",className:"  "},s.a.createElement(C,{data:this.data,minChartWidth:700}))}}]),n}(n.Component)),j=Object(M.a)({basename:"",forceRefresh:!1,keyLength:6,getUserConfirmation:function(e,t){return t(window.confirm(e))}});j.listen((function(e){}));var Q={};function B(e){e.hash in Q?Q[e.hash]=Q[e.hash]+1:Q[e.hash]=0}j.listen((function(e){B(e)}));var P=function(e){Object(c.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(o.a)(this,a),(n=t.call(this,e)).state={config:null},B(window.location),n.serverBasePath=window.location.protocol+"//"+window.location.host,n.configEndpoint="/api/config",n}return Object(l.a)(a,[{key:"componentDidMount",value:function(){var e=this,t=this.serverBasePath+this.configEndpoint,a=fetch(t).then((function(e){return 200!==e.status?(console.log("Looks like there was a problem. Status Code: "+e.status),Promise.reject(e.status)):e.json().then((function(e){return e}))})).catch((function(e){return Promise.reject(e)})),n=this;a.then((function(t){t&&e.setState({config:t})})).catch((function(e){console.log("Failed to fetch config, using default config.",e),n.setState({config:{header:{appname:"NeuralQA",appdescription:"Question Answering on Large Datasets"},queryview:{intro:{title:"NeuralQA: Question Answering on Large Datasets",subtitle:"NeuralQA is an interactive tool for question answering (passage retrieval + document reading). You can manually provide a passage or select a search index from (e.g. case.law ) dataset under the QA configuration settings below. To begin, type in a question query below.",disclaimer:" .. "},views:{intro:!0,advanced:!0,samples:!0,passages:!0,explanations:!0,allanswers:!1,expander:!1},options:{stride:{title:"Token Stride",selected:0,options:[{name:0,value:0},{name:50,value:50},{name:100,value:100},{name:200,value:200}]},maxdocuments:{title:"Max Documents",selected:5,options:[{name:5,value:5},{name:10,value:10},{name:15,value:15}]},fragmentsize:{title:"Fragment Size",selected:350,options:[{name:350,value:350},{name:450,value:450},{name:650,value:650},{name:850,value:850}]},relsnip:{title:"Relsnip",selected:!0,options:[{name:!0,value:!0},{name:!1,value:!1}]},samples:[{question:"what is the goal of the fourth amendment?  ",context:"The Fourth Amendment of the U.S. Constitution provides that the right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.'The ultimate goal of this provision is to protect people\u2019s right to privacy and freedom from unreasonable intrusions by the government. However, the Fourth Amendment does not guarantee protection from all searches and seizures, but only those done by the government and deemed unreasonable under the law."},{question:"Who was the first woman to serve on the supreme court in America",context:"Sandra Day O\u2019Connor, n\xe9e Sandra Day, (born March 26, 1930, El Paso, Texas, U.S.), associate justice of the Supreme Court of the United States from 1981 to 2006. She was the first woman to serve on the Supreme Court. A moderate conservative, she was known for her dispassionate and meticulously researched opinions. Sandra Day grew up on a large family ranch near Duncan, Arizona. She received undergraduate (1950) and law (1952) degrees from Stanford University, where she met the future chief justice of the United States William Rehnquist."},{question:"Where did Sandra Day grow up?",context:"Sandra Day O\u2019Connor, n\xe9e Sandra Day, (born March 26, 1930, El Paso, Texas, U.S.), associate justice of the Supreme Court of the United States from 1981 to 2006. She was the first woman to serve on the Supreme Court. A moderate conservative, she was known for her dispassionate and meticulously researched opinions. Sandra Day grew up on a large family ranch near Duncan, Arizona. She received undergraduate (1950) and law (1952) degrees from Stanford University, where she met the future chief justice of the United States William Rehnquist."}],expander:{title:"Expander",selected:"none",options:[{name:"None",value:"none",type:"none"}]},reader:{title:"Reader",selected:"twmkn9/distilbert-base-uncased-squad2",options:[{name:"DistilBERT SQUAD2",value:"twmkn9/distilbert-base-uncased-squad2",type:"distilbert"},{name:"BERT SQUAD2",value:"deepset/bert-base-cased-squad2",type:"bert"}]},retriever:{title:"Retriever",selected:"none",options:[{name:"None",value:"none",type:"none"},{name:"Case Law",value:"cases",host:"localhost",port:9200,username:"None",password:"None",type:"elasticsearch",fields:{body_field:"casebody.data.opinions.text"}}],readtopn:0}}}}})}))}},{key:"render",value:function(){var e=this;return s.a.createElement(g.a,null,this.state.config&&s.a.createElement("div",null,s.a.createElement(D,{data:this.state.config.header}),s.a.createElement("main",{className:"container-fluid p10"},s.a.createElement(k.a,{exact:!0,path:"/",component:function(t){return s.a.createElement(T,{data:e.state.config.queryview,serverBasePath:e.serverBasePath})}}),s.a.createElement(k.a,{exact:!0,path:"/ex",component:z}))),s.a.createElement("div",{id:"footer"},s.a.createElement(q,null)))}}]),a}(n.Component);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));r.a.render(s.a.createElement(P,null),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[61,1,2]]]);
  //# sourceMappingURL=main.32abfeaf.chunk.js.map